The following bug has been logged online:
Bug reference: 3857
Logged by: Jochen Schwarz
Email address: js@webmail.eurodata.de
PostgreSQL version: 8.2.6
Operating system: Windows and Linux
Description: pg_restore -t tablename doesn't restore constraints of
this table
Details:
pg_restore doesn't restore constraints if you only restore a table.
Here is a test-scenario:
create database test;
create table testtable ( id integer primary key );
test=# \d testtable
Tabelle »public.testtable«
Spalte | Typ | Attribute
--------+---------+-----------
id | integer | not null
Indexe:
»testtable_pkey« PRIMARY KEY, btree (id)
pg_dump -F c test >/tmp/test.dmp
drop table testtable;
pg_restore -F c -d test -t testtable /tmp/test.dmp
test=# \d testtable
Tabelle »public.testtable«
Spalte | Typ | Attribute
--------+---------+-----------
id | integer | not null
the primary key testtable_pkey is not restored!
pg_restore -F c -d test -I testtable_pkey is not working either.