Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 9F166632A2C for ; Fri, 1 May 2009 18:00:34 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 75162-10 for ; Fri, 1 May 2009 18:00:28 -0300 (ADT) X-Greylist: delayed 00:06:09.703313 by SQLgrey-1.7.6 Received: from leary.csoft.net (leary.csoft.net [205.205.214.5]) by mail.postgresql.org (Postfix) with ESMTP id 1F41F633BB6 for ; Fri, 1 May 2009 18:00:33 -0300 (ADT) Received: by leary.csoft.net (Postfix, from userid 1112) id 93F73A3CF; Fri, 1 May 2009 16:54:20 -0400 (EDT) Date: Fri, 1 May 2009 16:54:20 -0400 (EDT) From: Kris Jurka X-X-Sender: books@leary.csoft.net To: Adam B cc: pgsql-jdbc@postgresql.org Subject: Re: A basic Statement.getGeneratedKeys() implementation (patch attached) In-Reply-To: <49FB5E2D.4020105@videx.com> Message-ID: References: <49FB5E2D.4020105@videx.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.011 tagged_above=0 required=5 tests=AWL=0.011 X-Spam-Level: X-Archive-Number: 200905/7 X-Sequence-Number: 19557 On Fri, 1 May 2009, Adam B wrote: > Our webapp relies heavily on JDBC's Statement.getGeneratedKeys() > abstraction. We are investigating switching from Mysql to Postgre so I > created a basic implementation of this feature in the 8.3-604 version of > the driver. The diff patch is attached. This has some pretty severe restrictions and some more that aren't mentioned (overriding getUpdateCount(), not using the V2 protocol which has nothing to do with JDBC2/3). We've implemented generated key support in CVS for the upcoming 8.4 release that is more robust, but makes some other tradeoffs (returning all columns rather that just a single key). Could you test this out in your application? CVS info here: http://jdbc.postgresql.org/development/cvs.html A thread discussing how it doesn't work for a Spring application here: http://archives.postgresql.org//pgsql-jdbc/2009-04/threads.php#00081 Kris Jurka