Re: Last inserted id - Mailing list pgsql-odbc

From Tom Lane
Subject Re: Last inserted id
Date
Msg-id 19554.1005600712@sss.pgh.pa.us
Whole thread Raw
In response to Re: Last inserted id  ("Simeo Reig" <simreig@terra.es>)
List pgsql-odbc
"Simeo Reig" <simreig@terra.es> writes:
>> False.  Option B is multi-user safe, period.  The reason is that currval
>> returns the value last obtained by nextval *in your own session*,
>> independently of what anyone else has done meanwhile.

> What do you understand for *session* ? Same postgres connection ?

Same postgres connection.  If you are working in an application
environment that does connection pooling, or some such, then this
is unsafe and you'd better go back to option A.

            regards, tom lane

pgsql-odbc by date:

Previous
From: "Simeo Reig"
Date:
Subject: Re: Last inserted id
Next
From: Dave Page
Date:
Subject: Re: Last inserted id