From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
Cc: Heikki Hiltunen <heikki.hiltunen@smilehouse.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Problem with prepareStatement and Statement.RETURN_GENERATED_KEYS in PostgreSQL JDBC driver 8.4
Date: Thu, 12 Jun 2014 10:22:31 -0400
Message-ID: <20140612142231.GA27193@eldon.alvh.no-ip.org> (raw)
In-Reply-To: <4BD1C357.90506@enterprisedb.com>
References: <4BD196B4.3040607@smilehouse.com>
<4BD1C357.90506@enterprisedb.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-jdbc>
Heikki Linnakangas wrote:
> But that's not very bullet-proof, and will fail to detect the statement
> as an INSERT if it e.g begins with a comment. We could add a mini-parser
> to detect comments too, but it's not a very robust approach.
It will also fail to work with WITH clauses,
alvherre=# create table r (f int);
CREATE TABLE
alvherre=# insert into r values (42), (142857);
INSERT 0 2
alvherre=# with t as (select 1) update r set f = f + t."?column?" from t returning r.*;
f
--------
43
142858
(2 filas)
UPDATE 2
--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services
--
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc
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-jdbc@postgresql.org
Cc: alvherre@2ndquadrant.com, heikki.linnakangas@enterprisedb.com, heikki.hiltunen@smilehouse.com
Subject: Re: Problem with prepareStatement and Statement.RETURN_GENERATED_KEYS in PostgreSQL JDBC driver 8.4
In-Reply-To: <20140612142231.GA27193@eldon.alvh.no-ip.org>
References: <4BD196B4.3040607@smilehouse.com> <4BD1C357.90506@enterprisedb.com> <20140612142231.GA27193@eldon.alvh.no-ip.org>
* 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