Re: Last inserted id

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Simeo Reig" <simreig(at)terra(dot)es>
Cc: pgsql-odbc(at)postgresql(dot)org
Subject: Re: Last inserted id
Date: 2001-11-12 21:31:52
Message-ID: 19554.1005600712@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

"Simeo Reig" <simreig(at)terra(dot)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

In response to

Browse pgsql-odbc by date

  From Date Subject
Next Message Hiroshi Inoue 2001-11-12 23:39:05 Re: [ODBC] MD5 support for ODBC
Previous Message Simeo Reig 2001-11-12 20:43:02 Re: Last inserted id