Re: GetLastInsertID ? - Mailing list pgsql-general

From Dennis Bjorklund
Subject Re: GetLastInsertID ?
Date
Msg-id Pine.LNX.4.44.0401011711210.13889-100000@zigo.dhs.org
Whole thread Raw
In response to GetLastInsertID ?  (Stephane Pinel <spinel@noos.fr>)
Responses Re: GetLastInsertID ?
List pgsql-general
On Thu, 1 Jan 2004, Stephane Pinel wrote:

> the last inserted id in the table like we do with MySQL using the
> GetLastInsertID ?
>
> My need is to get back the new id just after inserting.

Use currval() after you have inserted.

http://www.postgresql.org/docs/current/static/functions-sequence.html

--
/Dennis


pgsql-general by date:

Previous
From: Michael Glaesemann
Date:
Subject: Re: Bug and/or feature? Complex data types in tables...
Next
From: Martijn van Oosterhout
Date:
Subject: Re: GetLastInsertID ?