Re: Problem with prepareStatement and Statement.RETURN_GENERATED_KEYS in PostgreSQL JDBC driver 8.4

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
Cc: Heikki Hiltunen <heikki(dot)hiltunen(at)smilehouse(dot)com>, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Problem with prepareStatement and Statement.RETURN_GENERATED_KEYS in PostgreSQL JDBC driver 8.4
Date: 2014-06-12 14:22:31
Message-ID: 20140612142231.GA27193@eldon.alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-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

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message David G Johnston 2014-06-12 14:51:14 Re: Problem with prepareStatement and Statement.RETURN_GENERATED_KEYS in PostgreSQL JDBC driver 8.4
Previous Message Dave Cramer 2014-06-12 13:13:08 Re: Hibernate over postgresql