Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id A0EF9632EC0 for ; Wed, 11 Aug 2010 10:10:00 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 85007-04 for ; Wed, 11 Aug 2010 13:09:51 +0000 (UTC) X-Greylist: delayed 00:10:00.036708 by SQLgrey-1.7.6 Received: from bsdmail.automate.com (66-192-119-41.static.twtelecom.net [66.192.119.41]) by mail.postgresql.org (Postfix) with ESMTP id 13EDC632915 for ; Wed, 11 Aug 2010 10:09:52 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by bsdmail.automate.com (Postfix) with ESMTP id 17F233FC062 for ; Wed, 11 Aug 2010 08:59:50 -0400 (EDT) X-Virus-Scanned: amavisd-new at automate.com Received: from bsdmail.automate.com ([127.0.0.1]) by localhost (bsdmail.automate.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1G8+9-HNb4Sf for ; Wed, 11 Aug 2010 08:59:48 -0400 (EDT) Received: from atodorski.automate.com (atodorski.automate.local [172.16.5.157]) by bsdmail.automate.com (Postfix) with ESMTP id EAB683FC059 for ; Wed, 11 Aug 2010 08:59:48 -0400 (EDT) Received: from [172.16.5.157] (atodorski.automate.local [172.16.5.157]) by atodorski.automate.com (Postfix) with ESMTPS id 1F60B915BD for ; Wed, 11 Aug 2010 08:59:14 -0400 (EDT) Message-ID: <4C629EA1.3020409@automate.com> Date: Wed, 11 Aug 2010 08:59:13 -0400 From: Adam Todorski User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.7) Gecko/20100713 Lightning/1.0b2 Thunderbird/3.1.1 MIME-Version: 1.0 To: pgsql-jdbc@postgresql.org Subject: Returning generated keys Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201008/48 X-Sequence-Number: 20851 I would like to clarify the pgsql JDBC's current and intended future handling of returning auto-generated keys. As far as I can tell, currently all inserted columns are returned, not just any that were auto-generated and are keys: The changelog for 8.4dev-700 says: "Implement basic generated keys support. It does not support returning columns by index because that requires complicated parsing of the query to determine the table being used. Right now it supports returning all columns and columns by name. (jurka)" Is there a time line for fully implementing this functionality? Also, wouldn't the query parsing resolve to either the third token (query split on non-word characters limit four matches: "insert into ") or determining for each trigger fired by the query if it resulted in data being inserted and applying the same logic to those queries? Thanks! Adam