Re: Last ID - Mailing list pgsql-novice

From Brett W. McCoy
Subject Re: Last ID
Date
Msg-id Pine.LNX.4.30.0103021351090.22539-100000@chapelperilous.net
Whole thread Raw
In response to Re: Last ID  (Catalin CIOCOIU <catalin.ciocoiu@inpg.fr>)
List pgsql-novice
On Fri, 2 Mar 2001, Catalin CIOCOIU wrote:

>     This method don't encourage using serial data type. Practically, in the
> joined table I can't use "serial" data type for primary key. I nead to
> use sequences by hand.
>     The last solution work fine, but I need a variable for store the
> nextval('<seq name>').
>
> There is not a other solution ?

It turns out I was wrong -- using currval is session-based, as Tom Lane
has pointed out.  However, still see the notes in the docs on caching
more than one values for each backend.  This may or not be pertinent.

-- Brett
                                     http://www.chapelperilous.net/~bmccoy/
---------------------------------------------------------------------------
While money doesn't buy love, it puts you in a great bargaining position.


pgsql-novice by date:

Previous
From: "Chuck Kimber"
Date:
Subject: RE: Last ID
Next
From: "Donald Braman"
Date:
Subject: www.postgresql.org