Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 5275A9FB47E for ; Sat, 20 Jan 2007 01:44:06 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-new, port 10024) with ESMTP id 51195-07 for ; Sat, 20 Jan 2007 01:44:03 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from www01.kensystem.com (www01.kensystem.com [72.19.170.120]) by postgresql.org (Postfix) with ESMTP id 2D8039F9FEF for ; Sat, 20 Jan 2007 01:44:03 -0400 (AST) Received: from 192.168.0.3 by www01.kensystem.com (SMTPD); id s20070120054353.6262; Sat, 20 Jan 2007 05:43:53 Message-ID: <45B1AC19.3090300@kensystem.com> Date: Fri, 19 Jan 2007 22:43:53 -0700 From: Ken Johanson User-Agent: Thunderbird 1.5.0.9 (Windows/20061207) MIME-Version: 1.0 To: pgsql-jdbc@postgresql.org CC: Michael Paesold Subject: Re: Synthesize support for Statement.getGeneratedKeys()? References: <4580E681.3080106@kensystem.com> <45810230.80803@gmx.at> In-Reply-To: <45810230.80803@gmx.at> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200701/127 X-Sequence-Number: 16492 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. 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?). 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? Thanks again, Ken