Re: pg_restore -t table doesn't restore PKEY

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Jan C(dot)" <chaljan(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: pg_restore -t table doesn't restore PKEY
Date: 2010-10-29 14:30:40
Message-ID: 1183.1288362640@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Jan C." <chaljan(at)gmail(dot)com> writes:
> I have dump of an entire database and I'm trying to restore only one named
> table:

>> pg_restore --format=c -C -U myUser -d myDB /tmp/mydump -t my_table

> The command completes without errors/warnings but the resulting table in the
> database is missing the PKEY constraint !

Use pg_restore -l, then extract the lines relevant to your table, then
pg_restore -L to restore just the named items.

I think there's a TODO to make pg_restore's -t switch work more like
pg_dump's, but at the moment they're really quite different animals.
pg_restore doesn't have any logic about "oh, if he asked for this
item I bet he wants that one too".

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Karl Pickett 2010-10-29 14:32:12 Re: Can Postgres Not Do This Safely ?!?
Previous Message Tom Lane 2010-10-29 14:25:49 Re: create table as select VS create table; insert as select