Re: currval() race condition on server? - Mailing list pgsql-jdbc

From Tom Lane
Subject Re: currval() race condition on server?
Date
Msg-id 23634.1161613423@sss.pgh.pa.us
Whole thread Raw
In response to currval() race condition on server?  (Adriaan Joubert <a.joubert@albourne.com>)
Responses Re: currval() race condition on server?  (Oliver Jowett <oliver@opencloud.com>)
List pgsql-jdbc
Adriaan Joubert <a.joubert@albourne.com> writes:
> For some bookkeeping purposes I need the new audit number back from the
> update, so I submit a prepared statement through jdbc of the form
>
> UPDATE A SET ....; SELECT currval('ip_audit_seq');

It's not possible to put two SQL commands into one prepared statement
--- at least not for the normal server-side meaning of "prepared statement".
I dunno what the JDBC driver is doing with this, but I wonder if it's
silently dropping the UPDATE part :-(

            regards, tom lane

pgsql-jdbc by date:

Previous
From: Achilleas Mantzios
Date:
Subject: Re: currval() race condition on server?
Next
From: Dave Cramer
Date:
Subject: Re: currval() race condition on server?