pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paesold <mpaesold@gmx.at>
To: Ken Johanson <pg-user@kensystem.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Synthesize support for Statement.getGeneratedKeys()?
Date: Sat, 20 Jan 2007 12:08:41 +0100
Message-ID: <45B1F839.3060402@gmx.at> (raw)
In-Reply-To: <45B1AC19.3090300@kensystem.com>
References: <4580E681.3080106@kensystem.com>
	<45810230.80803@gmx.at>
	<45B1AC19.3090300@kensystem.com>

Ken Johanson wrote:
> Michael Paesold wrote:
>> Ken Johanson wrote:
>>> Hello,
>>>
>>> I've just come to realize that Statement.getGeneratedKeys() is not 
>>> supported in the current PG and/or JDBC driver. Does someone know if 
>>> this is a limitation of PG, or its protocol, or just not yet 
>>> implemented in the JDBC driver? I'm just wondering where, if at all 
>>> (if I have enough brain cells that is :), I could try to offer a 
>>> patch or ideas..
>>
>> It would be possible to implement that using the RETURNING clause 
>> supported in recent versions of the server.
>>
>> See here:
>> http://archives.postgresql.org/pgsql-jdbc/2006-10/msg00035.php
>> http://archives.postgresql.org/pgsql-jdbc/2006-10/msg00037.php
>>
>> Unfortunately, all my available spare time went into implementing 
>> support for standards_conforming_strings in the 8.2 release cycle.
>>
> 
> Michael, does it look like you might have the time for this in the next 
> couple months? If not and no one else more familar/rofiecient with the 
> private API will have time, then I giuess I should dig in and try... 
> even if I need to ramp up to the server protocol to do it.

Unfortunately I did not find time to work on this over Christmas 
holidays and I will be quite busy at work for the next two or three 
months or so. Thus, if you have time to work on this yourself, please go 
ahead!

> If someone has pointers to where the augmentaion code should be placed 
> (org.tgresql.jdbc3.Jdbc3ResultSetMetadata I presume), and also the 
> protocol (separate query to the server?, or append RETURNING clause to 
> the DML?).

Right now, the server protocol does not have a separate facility for the 
RETURNING functionality. Therefore you have to append a RETURNING clause 
   to the query string.

> Also I cant remember - is it true that when inserting multuple VALUES, 
> that only the first (or last) SEQUENCE can be retrived, or can I 
> populate a resultset using the RETURNING data from by the server?

I suppose it should work with multiple VALUES, but you can simple try. ;-)

Best Regards
Michael Paesold




view thread (50+ messages)  latest in thread

Message-ID: <45B1F839.3060402@gmx.at>
Permalink:  ../45B1F839.3060402@gmx.at/
Also on:    postgresql.org/message-id/45B1F839.3060402@gmx.at

 · 

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-jdbc@postgresql.org
  Cc: mpaesold@gmx.at, pg-user@kensystem.com
  Subject: Re: Synthesize support for Statement.getGeneratedKeys()?
  In-Reply-To: <45B1F839.3060402@gmx.at>
  References: <4580E681.3080106@kensystem.com> <45810230.80803@gmx.at> <45B1AC19.3090300@kensystem.com> <45B1F839.3060402@gmx.at>

* 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