Re: Re: OID as Primary Key

From: "Brent R(dot) Matzelle" <bmatzelle(at)yahoo(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Re: OID as Primary Key
Date: 2001-03-22 16:35:47
Message-ID: 20010322163547.77338.qmail@web13005.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

--- Jonas Bengtsson <jonas(dot)b(at)home(dot)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/

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Michael Ansley 2001-03-22 16:50:26 RE: Re: OID as Primary Key
Previous Message Peter Eisentraut 2001-03-22 16:33:38 Re: Re: Call for platforms