BUG #3857: pg_restore -t tablename doesn't restore constraints of this table - Mailing list pgsql-bugs

From Jochen Schwarz
Subject BUG #3857: pg_restore -t tablename doesn't restore constraints of this table
Date
Msg-id 200801081502.m08F2MES052041@wwwmaster.postgresql.org
Whole thread Raw
List pgsql-bugs
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.

pgsql-bugs by date:

Previous
From: "Diego Spano"
Date:
Subject: Re: BUG #3850: Incompatibility among pg_dump / pg_restore.
Next
From: Tom Lane
Date:
Subject: Re: BUG #3855: backend sends corrupted data on EHOSTDOWN error