Thread: BUG #6461: "-t" deletes primary key

BUG #6461: "-t" deletes primary key

From
lenka.piyush@gmail.com
Date:
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:=20=20=20=20=20=20=20=20

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

Re: BUG #6461: "-t" deletes primary key

From
Tom Lane
Date:
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

Re: BUG #6461: "-t" deletes primary key

From
Peter Eisentraut
Date:
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.

Re: BUG #6461: "-t" deletes primary key

From
Boszormenyi Zoltan
Date:
2012-02-19 09:30 keltez=C3=A9ssel, Peter Eisentraut =C3=ADrta:
> 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...=20
>> This is not a bug.  -t selects the table only, not associated indexes.

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

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


--=20
----------------------------------
Zolt=C3=A1n B=C3=B6sz=C3=B6rm=C3=A9nyi
Cybertec Sch=C3=B6nig & Sch=C3=B6nig GmbH
Gr=C3=B6hrm=C3=BChlgasse 26
A-2700 Wiener Neustadt, Austria
Web: http://www.postgresql-support.de
     http://www.postgresql.at/

Re: BUG #6461: "-t" deletes primary key

From
Tom Lane
Date:
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