pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Adriaan Joubert <a.joubert@albourne.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: currval() race condition on server?
Date: Mon, 23 Oct 2006 10:23:43 -0400
Message-ID: <23634.1161613423@sss.pgh.pa.us> (raw)
In-Reply-To: <453CC859.8070306@albourne.com>
References: <453CC859.8070306@albourne.com>

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



view thread (11+ messages)  latest in thread

Message-ID: <23634.1161613423@sss.pgh.pa.us>
Permalink:  ../23634.1161613423@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/23634.1161613423@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: tgl@sss.pgh.pa.us, a.joubert@albourne.com, pgsql-jdbc@postgresql.org
  Subject: Re: currval() race condition on server?
  In-Reply-To: <23634.1161613423@sss.pgh.pa.us>
  References: <453CC859.8070306@albourne.com> <23634.1161613423@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox