Re: Getting Primary Key Value After Insert - Mailing list pgsql-general

From Richard Broersma Jr
Subject Re: Getting Primary Key Value After Insert
Date
Msg-id 20060709060226.25396.qmail@web31802.mail.mud.yahoo.com
Whole thread Raw
In response to Re: Getting Primary Key Value After Insert  (Greg Stark <gsstark@mit.edu>)
Responses Re: Getting Primary Key Value After Insert  (Douglas McNaught <doug@mcnaught.org>)
Re: Getting Primary Key Value After Insert  (Martijn van Oosterhout <kleptog@svana.org>)
List pgsql-general
> > > 3.  If you call currval() will it return 20?  I would think it does.
>
> Yes it does.
>
> > My understanding is that it will provided your are within a transaction.
>
> As long as you're in the same session you're fine. You would have to go out of
> your way to break it but if you're using some sort of connection pooling you
> wouldn't want to pull a fresh connection from the pool, for example.

Just to clarify,  currval() is isolated by the session on not necessarily by a transaction?

Regards,

Richard Broersma Jr.

pgsql-general by date:

Previous
From: Greg Stark
Date:
Subject: Re: Getting Primary Key Value After Insert
Next
From: Roman Neuhauser
Date:
Subject: Re: Version/Change Management of functions?