BUG #6461: "-t" deletes primary key

Started by Piyush Lenkaabout 14 years ago5 messagesbugs
Jump to latest
#1Piyush Lenka
lenka.piyush@gmail.com

The following bug has been logged on the website:

Bug reference: 6461
Logged by: Piyush
Email address: lenka.piyush@gmail.com
PostgreSQL version: 9.1.2
Operating system: Windows XP
Description:

when i restore a particular table using pg_restore (using option "-t") it
doesn't restore my primary key...

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Piyush Lenka (#1)
Re: BUG #6461: "-t" deletes primary key

lenka.piyush@gmail.com writes:

when i restore a particular table using pg_restore (using option "-t") it
doesn't restore my primary key...

This is not a bug. -t selects the table only, not associated indexes.

regards, tom lane

#3Peter Eisentraut
peter_e@gmx.net
In reply to: Tom Lane (#2)
Re: BUG #6461: "-t" deletes primary key

On fre, 2012-02-17 at 12:01 -0500, Tom Lane wrote:

lenka.piyush@gmail.com writes:

when i restore a particular table using pg_restore (using option "-t") it
doesn't restore my primary key...

This is not a bug. -t selects the table only, not associated indexes.

But from a user's perspective, that behavior seems kind of useless.

#4Boszormenyi Zoltan
zb@cybertec.at
In reply to: Peter Eisentraut (#3)
Re: BUG #6461: "-t" deletes primary key

2012-02-19 09:30 keltezéssel, Peter Eisentraut írta:

On fre, 2012-02-17 at 12:01 -0500, Tom Lane wrote:

lenka.piyush@gmail.com writes:

when i restore a particular table using pg_restore (using option "-t") it
doesn't restore my primary key...

This is not a bug. -t selects the table only, not associated indexes.

The associated sequence != indexes on the same table, but yes, it's a little annoying
sometimes.

But from a user's perspective, that behavior seems kind of useless.

--
----------------------------------
Zoltán Böszörményi
Cybertec Schönig & Schönig GmbH
Gröhrmühlgasse 26
A-2700 Wiener Neustadt, Austria
Web: http://www.postgresql-support.de
http://www.postgresql.at/

#5Tom Lane
tgl@sss.pgh.pa.us
In reply to: Peter Eisentraut (#3)
Re: BUG #6461: "-t" deletes primary key

Peter Eisentraut <peter_e@gmx.net> writes:

On fre, 2012-02-17 at 12:01 -0500, Tom Lane wrote:

lenka.piyush@gmail.com writes:

when i restore a particular table using pg_restore (using option "-t") it
doesn't restore my primary key...

This is not a bug. -t selects the table only, not associated indexes.

But from a user's perspective, that behavior seems kind of useless.

Well, I can see the possible usefulness of a switch that says "give me
this table and all associated indexes/constraints" (other than FK
constraints, likely). But it would be something new, not -t.

regards, tom lane