Re: GetLastInsertID ?

From: Mike Nolan <nolan(at)gw(dot)tssi(dot)com>
To: db(at)zigo(dot)dhs(dot)org (Dennis Bjorklund)
Cc: spinel(at)noos(dot)fr (Stephane Pinel), pgsql-general(at)postgresql(dot)org
Subject: Re: GetLastInsertID ?
Date: 2004-01-01 21:37:46
Message-ID: 200401012137.i01Lblr6003362@gw.tssi.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> > 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.

That will not necessarily tell you the last insertion, depending
upon how many other users there are doing inserts.

For that matter, I'm not sure that the MySQL method works with multiple
users either.
--
Mike Nolan

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Stephane Pinel 2004-01-01 21:40:57 Re: GetLastInsertID ?
Previous Message Mark Kirkwood 2004-01-01 21:07:44 Re: Mnogosearch (Was: Re: website doc search is ... )