Re: mysql's last_insert_id - Mailing list pgsql-general

From Dennis Björklund
Subject Re: mysql's last_insert_id
Date
Msg-id Pine.LNX.4.44.0308281001060.31606-100000@zigo.dhs.org
Whole thread Raw
In response to Re: mysql's last_insert_id  (Bo Lorentsen <bl@netgroup.dk>)
Responses Re: mysql's last_insert_id  (Bo Lorentsen <bl@netgroup.dk>)
List pgsql-general
On 28 Aug 2003, Bo Lorentsen wrote:

> Now ... I know that its possible to omit the oid's from large tables,
> and then this method will not work anymore. What to do in this case
> still eludes me (Anyone ?) :-)

Yes, never use the oid at all is my suggestion.

If you need a unique id for a row then add a serial column that will
provide that, and use currval('the_sequence') to get the last inserted
value in that column for a session.

--
/Dennis


pgsql-general by date:

Previous
From: "Keow Yeong Huat Joseph"
Date:
Subject: Re: Postgresql for Solaris on Sparc
Next
From: "Andrew L. Gould"
Date:
Subject: Re: Question Join/Subselect