pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Bruce Momjian <pgman@candle.pha.pa.us>
Cc: Jie Liang <jie@stbernard.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: pg_restore cannot restore an index
Date: Thu, 16 Jan 2003 13:34:17 -0500
Message-ID: <26074.1042742057@sss.pgh.pa.us> (raw)
In-Reply-To: <200301161807.h0GI7Ld04361@candle.pha.pa.us>
References: <200301161807.h0GI7Ld04361@candle.pha.pa.us>

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



view thread (4+ messages)  latest in thread

Message-ID: <26074.1042742057@sss.pgh.pa.us>
Permalink:  ../26074.1042742057@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/26074.1042742057@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, pgman@candle.pha.pa.us, jie@stbernard.com
  Subject: Re: pg_restore cannot restore an index
  In-Reply-To: <26074.1042742057@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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