Re: currval() race condition on server?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Adriaan Joubert <a(dot)joubert(at)albourne(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: currval() race condition on server?
Date: 2006-10-23 14:23:43
Message-ID: 23634.1161613423@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-jdbc

Adriaan Joubert <a(dot)joubert(at)albourne(dot)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

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Dave Cramer 2006-10-23 14:34:36 Re: currval() race condition on server?
Previous Message Achilleas Mantzios 2006-10-23 14:04:04 Re: currval() race condition on server?

Browse pgsql-jdbc by date

  From Date Subject
Next Message Dave Cramer 2006-10-23 14:34:36 Re: currval() race condition on server?
Previous Message Achilleas Mantzios 2006-10-23 14:04:04 Re: currval() race condition on server?