Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 1B9EA9FB433 for ; Mon, 23 Oct 2006 11:24:24 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 64126-03 for ; Mon, 23 Oct 2006 11:24:11 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id CA9FD9FA9BD for ; Mon, 23 Oct 2006 11:24:10 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id k9NENhZb023635; Mon, 23 Oct 2006 10:23:43 -0400 (EDT) To: Adriaan Joubert cc: pgsql-jdbc@postgresql.org Subject: Re: currval() race condition on server? In-reply-to: <453CC859.8070306@albourne.com> References: <453CC859.8070306@albourne.com> Comments: In-reply-to Adriaan Joubert message dated "Mon, 23 Oct 2006 16:49:13 +0300" Date: Mon, 23 Oct 2006 10:23:43 -0400 Message-ID: <23634.1161613423@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=2.007 tagged_above=0 required=5 tests=AWL, SPF_HELO_SOFTFAIL, SPF_SOFTFAIL X-Spam-Level: ** X-Archive-Number: 200610/101 X-Sequence-Number: 15984 Adriaan Joubert 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