The following bug has been logged online:

Bug reference:      3857
Logged by:          Jochen Schwarz
Email address:      [EMAIL PROTECTED]
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.

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
       choose an index scan if your joining column's datatypes do not
       match

Reply via email to