Re: Re: OID as Primary Key

From: Jonas Bengtsson <jonas(dot)b(at)home(dot)se>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Re: OID as Primary Key
Date: 2001-03-22 15:25:41
Message-ID: 985274741.141jonas.b@home.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(dot)b(at)home(dot)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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Anand Raman 2001-03-22 15:30:47 Re: transaction aborted with error
Previous Message Tom Lane 2001-03-22 15:23:21 Re: non-existent user "28"