Re: Re: OID as Primary Key - Mailing list pgsql-general

From Jonas Bengtsson
Subject Re: Re: OID as Primary Key
Date
Msg-id 985274741.141jonas.b@home.se
Whole thread Raw
In response to OID as Primary Key  (Jonas Bengtsson <jonas.b@home.se>)
Responses Re: Re: OID as Primary Key  ("Brent R. Matzelle" <bmatzelle@yahoo.com>)
List pgsql-general
Can't you do a dump with the oid's?

But when I want to know the primary key of the inserted row
I have to do an extra select query. If I use oid I just use
pg_getlastoid() in php.
And it is redundant data to store another integer.

Comments?

/Jonas B

> Jonas Bengtsson <jonas.b@home.se> writes:
> > I have problems with using OID as PK.
>
> This strikes me as a fairly bad idea in any case.  What
happens if you
> must dump and reload your database?  Better to use a
SERIAL column as
> primary key.
>
>             regards, tom lane
>



Mvh,
Jonas Bengtsson


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: non-existent user "28"
Next
From: Peter Choe
Date:
Subject: creating a trigger to write to a different table