Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id AC064476B7E for ; Thu, 16 Jan 2003 13:35:29 -0500 (EST) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id 84EBC476D90 for ; Thu, 16 Jan 2003 13:34:28 -0500 (EST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.6/8.12.6) with ESMTP id h0GIYH5u026075; Thu, 16 Jan 2003 13:34:17 -0500 (EST) To: Bruce Momjian Cc: Jie Liang , pgsql-sql@postgresql.org Subject: Re: pg_restore cannot restore an index In-reply-to: <200301161807.h0GI7Ld04361@candle.pha.pa.us> References: <200301161807.h0GI7Ld04361@candle.pha.pa.us> Comments: In-reply-to Bruce Momjian message dated "Thu, 16 Jan 2003 13:07:21 -0500" Date: Thu, 16 Jan 2003 13:34:17 -0500 Message-ID: <26074.1042742057@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/267 X-Sequence-Number: 11132 Bruce Momjian 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