Re: GetLastInsertID ?

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

> Where do you get that impression? currval() refers to the last ID for the
> session you are in. It's also FAQ question 4.15.3. Even better, if you
> havn't used nextval() in your current session, currval() returns an error,
> so you can't even get it wrong by accident.

I stand corrected. I was doing some testing of a PHP module that is
called from a web form a while back and got inconsistent results with
currval, I probably had a script error of some kind.
--
Mike Nolan

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Peter Eisentraut 2004-01-04 18:53:36 Re: psql \d option list overloaded
Previous Message Scott Ribe 2004-01-04 17:31:51 Re: Scripting a new db server setup