pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedpg_restore cannot restore an index
4+ messages / 3 participants
[nested] [flat]
* pg_restore cannot restore an index
@ 2003-01-16 17:39 Jie Liang <jie@stbernard.com>
0 siblings, 1 reply; 4+ messages in thread
From: Jie Liang @ 2003-01-16 17:39 UTC (permalink / raw)
To: Bruce Momjian <pgman@candle.pha.pa.us>; Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-sql
Last July, I pointed out this problem when I use v7.2.1, I got the answer that will be resolved in v7.3, however, I am using v7.3.1, pg_restore.c seems have no change in this section. So it still doesn't work.
Jie Liang
Jie Liang wrote:
> I read the pg_restore.c source code, I found:
> #ifdef HAVE_GETOPT_LONG
> struct option cmdopts[] = {
> {"clean", 0, NULL, 'c'},
> {"create", 0, NULL, 'C'},
> {"data-only", 0, NULL, 'a'},
> {"dbname", 1, NULL, 'd'},
> {"file", 1, NULL, 'f'},
> {"format", 1, NULL, 'F'},
> {"function", 1, NULL, 'P'},
> {"host", 1, NULL, 'h'},
> {"ignore-version", 0, NULL, 'i'},
> {"index", 1, NULL, 'I'},
> So, -i may be mapped wrong, however, -I is illegal option.
>
> Thanks!
>
>
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: pg_restore cannot restore an index
@ 2003-01-16 18:07 Bruce Momjian <pgman@candle.pha.pa.us>
parent: Jie Liang <jie@stbernard.com>
0 siblings, 1 reply; 4+ messages in thread
From: Bruce Momjian @ 2003-01-16 18:07 UTC (permalink / raw)
To: Jie Liang <jie@stbernard.com>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; pgsql-sql
Yes, I remember this. The code in 7.3 looks OK to me. Can you show me a
command line that fails for you?
I just tried:
$ pg_restore -I x asdf
pg_restore: [archiver] could not open input file: No such file or directory
so it looks like -I is working.
---------------------------------------------------------------------------
Jie Liang wrote:
> Last July, I pointed out this problem when I use v7.2.1, I got the answer that will be resolved in v7.3, however, I am using v7.3.1, pg_restore.c seems have no change in this section. So it still doesn't work.
>
> Jie Liang
>
>
>
> Jie Liang wrote:
> > I read the pg_restore.c source code, I found:
> > #ifdef HAVE_GETOPT_LONG
> > struct option cmdopts[] = {
> > {"clean", 0, NULL, 'c'},
> > {"create", 0, NULL, 'C'},
> > {"data-only", 0, NULL, 'a'},
> > {"dbname", 1, NULL, 'd'},
> > {"file", 1, NULL, 'f'},
> > {"format", 1, NULL, 'F'},
> > {"function", 1, NULL, 'P'},
> > {"host", 1, NULL, 'h'},
> > {"ignore-version", 0, NULL, 'i'},
> > {"index", 1, NULL, 'I'},
> > So, -i may be mapped wrong, however, -I is illegal option.
> >
> > Thanks!
> >
> >
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
>
--
Bruce Momjian | http://candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: pg_restore cannot restore an index
@ 2003-01-16 18:34 Tom Lane <tgl@sss.pgh.pa.us>
parent: Bruce Momjian <pgman@candle.pha.pa.us>
0 siblings, 0 replies; 4+ messages in thread
From: Tom Lane @ 2003-01-16 18:34 UTC (permalink / raw)
To: Bruce Momjian <pgman@candle.pha.pa.us>; +Cc: Jie Liang <jie@stbernard.com>; pgsql-sql
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> Yes, I remember this. The code in 7.3 looks OK to me. Can you show me a
> command line that fails for you?
It does in fact work for me --- if the object in question is recorded as
an INDEX in the dump. These days, lots of things get recorded as
CONSTRAINTs instead. For example, given
create table t1 (f1 int primary key);
create table t2 (f1 int primary key);
create table foo(f1 int);
create index fooey on foo(f1);
I get a dump that has a TOC like
$ pg_restore -l z.dump
...
2; 149798 TABLE t1 postgres
3; 149802 TABLE t2 postgres
4; 149806 TABLE foo postgres
8; 149798 TABLE DATA t1 postgres
9; 149802 TABLE DATA t2 postgres
10; 149806 TABLE DATA foo postgres
7; 149808 INDEX fooey postgres
5; 149800 CONSTRAINT t1_pkey postgres
6; 149804 CONSTRAINT t2_pkey postgres
and the -I option will find "fooey", but not "t1_pkey" or "t2_pkey".
Perhaps the gripe is really that we need a "restore specific constraint"
option? If so, should we overload -I or invent a separate switch?
regards, tom lane
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: pg_restore cannot restore an index
@ 2003-01-16 22:21 Jie Liang <jie@stbernard.com>
0 siblings, 0 replies; 4+ messages in thread
From: Jie Liang @ 2003-01-16 22:21 UTC (permalink / raw)
To: Bruce Momjian <pgman@candle.pha.pa.us>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; pgsql-sql
Sorry, it because I have another index with same indexname because pg_restore index fail.
Thanks.
Jie Liang
-----Original Message-----
From: Bruce Momjian [mailto:pgman@candle.pha.pa.us]
Sent: Thursday, January 16, 2003 10:07 AM
To: Jie Liang
Cc: Tom Lane; pgsql-sql@postgresql.org
Subject: Re: [SQL] pg_restore cannot restore an index
Yes, I remember this. The code in 7.3 looks OK to me. Can you show me a
command line that fails for you?
I just tried:
$ pg_restore -I x asdf
pg_restore: [archiver] could not open input file: No such file or directory
so it looks like -I is working.
---------------------------------------------------------------------------
Jie Liang wrote:
> Last July, I pointed out this problem when I use v7.2.1, I got the answer that will be resolved in v7.3, however, I am using v7.3.1, pg_restore.c seems have no change in this section. So it still doesn't work.
>
> Jie Liang
>
>
>
> Jie Liang wrote:
> > I read the pg_restore.c source code, I found:
> > #ifdef HAVE_GETOPT_LONG
> > struct option cmdopts[] = {
> > {"clean", 0, NULL, 'c'},
> > {"create", 0, NULL, 'C'},
> > {"data-only", 0, NULL, 'a'},
> > {"dbname", 1, NULL, 'd'},
> > {"file", 1, NULL, 'f'},
> > {"format", 1, NULL, 'F'},
> > {"function", 1, NULL, 'P'},
> > {"host", 1, NULL, 'h'},
> > {"ignore-version", 0, NULL, 'i'},
> > {"index", 1, NULL, 'I'},
> > So, -i may be mapped wrong, however, -I is illegal option.
> >
> > Thanks!
> >
> >
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
>
--
Bruce Momjian | http://candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2003-01-16 22:21 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-01-16 17:39 pg_restore cannot restore an index Jie Liang <jie@stbernard.com>
2003-01-16 18:07 ` Bruce Momjian <pgman@candle.pha.pa.us>
2003-01-16 18:34 ` Tom Lane <tgl@sss.pgh.pa.us>
2003-01-16 22:21 Re: pg_restore cannot restore an index Jie Liang <jie@stbernard.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox