Re: GetLastInsertID ?

From: Dennis Bjorklund <db(at)zigo(dot)dhs(dot)org>
To: Stephane Pinel <spinel(at)noos(dot)fr>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: GetLastInsertID ?
Date: 2004-01-01 16:12:25
Message-ID: Pine.LNX.4.44.0401011711210.13889-100000@zigo.dhs.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Martijn van Oosterhout 2004-01-01 16:14:43 Re: GetLastInsertID ?
Previous Message Michael Glaesemann 2004-01-01 15:48:22 Re: Bug and/or feature? Complex data types in tables...