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

From Michael Ansley
Subject RE: Re: OID as Primary Key
Date
Msg-id 7F124BC48D56D411812500D0B747251480F4E1@FILESERVER002
Whole thread Raw
In response to OID as Primary Key  (Jonas Bengtsson <jonas.b@home.se>)
Responses RE: Re: OID as Primary Key  ("Jonas Bengtsson" <jonas.b@home.se>)
List pgsql-general

And you can get the last SERIAL inserted using currval.

MikeA

>> -----Original Message-----
>> From: Brent R. Matzelle [mailto:bmatzelle@yahoo.com]
>> Sent: 22 March 2001 16:36
>> To: pgsql-general@postgresql.org
>> Subject: Re: Re: [GENERAL] OID as Primary Key
>>
>>
>> --- 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/
>>
>> ---------------------------(end of
>> broadcast)---------------------------
>> TIP 1: subscribe and unsubscribe commands go to
>> majordomo@postgresql.org
>>

_________________________________________________________________________
This e-mail and any attachments are confidential and may also be privileged and/or copyright
material of Intec Telecom Systems PLC (or its affiliated companies). If you are not an
intended or authorised recipient of this e-mail or have received it in error, please delete
it immediately and notify the sender by e-mail. In such a case, reading, reproducing,
printing or further dissemination of this e-mail is strictly prohibited and may be unlawful.
Intec Telecom Systems PLC. does not represent or warrant that an attachment hereto is free
from computer viruses or other defects. The opinions expressed in this e-mail and any
attachments may be those of the author and are not necessarily those of Intec Telecom
Systems PLC.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.
__________________________________________________________________________

pgsql-general by date:

Previous
From: "Brent R. Matzelle"
Date:
Subject: Re: Re: OID as Primary Key
Next
From: "Jonas Bengtsson"
Date:
Subject: RE: Re: OID as Primary Key