Re: mysql's last_insert_id

From: Dennis Björklund <db(at)zigo(dot)dhs(dot)org>
To: Bo Lorentsen <bl(at)netgroup(dot)dk>
Cc: Michal Adamczakk <pokryfka(at)artland(dot)com(dot)pl>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: mysql's last_insert_id
Date: 2003-08-28 08:02:38
Message-ID: Pine.LNX.4.44.0308281001060.31606-100000@zigo.dhs.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Andrew L. Gould 2003-08-28 08:58:04 Re: Question Join/Subselect
Previous Message Keow Yeong Huat Joseph 2003-08-28 07:57:54 Re: Postgresql for Solaris on Sparc