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

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

Yes, but I would never suggest it.

> 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.

You should not use oid's as primary keys just because you want
to save a little HD space.

I contributed a some code on PHPBuilder for a function that
returns the insert id of a SERIAL primary key.  You can view it
here:
http://www.phpbuilder.com/snippet/download.php?type=snippet&id=304
.  It works well for me and it does not kludge my code like
using the oid does.

Brent

__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.
http://personal.mail.yahoo.com/

pgsql-general by date:

Previous
From: "Brent R.Matzelle"
Date:
Subject: Re: Changing from rpm to Compiled version
Next
From: Michael Ansley
Date:
Subject: RE: Re: OID as Primary Key