Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id AF55F9FB4D3 for ; Mon, 22 Jan 2007 10:20:08 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-new, port 10024) with ESMTP id 30701-08 for ; Mon, 22 Jan 2007 10:19:50 -0400 (AST) X-Greylist: delayed 00:20:56.390244 by SQLgrey-1.7.4 Received: from mail.gtech.kiev.ua (mail.gtech.kiev.ua [213.186.209.2]) by postgresql.org (Postfix) with ESMTP id 614BE9FB255 for ; Mon, 22 Jan 2007 10:19:53 -0400 (AST) Received: from localhost ([127.0.0.1]) by mail.gtech.kiev.ua (using TLSv1/SSLv3 with cipher AES256-SHA (256 bits)) for pgsql-jdbc@postgresql.org; Mon, 22 Jan 2007 16:59:03 +0200 Message-ID: <45B4C31A.7060304@gtech-ua.com> Date: Mon, 22 Jan 2007 15:58:50 +0200 From: Vit Timchishin User-Agent: Thunderbird 1.5.0.9 (X11/20060911) MIME-Version: 1.0 To: pgsql-jdbc@postgresql.org Subject: Re: Synthesize support for Statement.getGeneratedKeys()? References: <4580E681.3080106@kensystem.com> <45810230.80803@gmx.at> <45B1AC19.3090300@kensystem.com> <45B1F839.3060402@gmx.at> <45B254D7.4080304@kensystem.com> <55027648-0777-4BE4-8581-933E86180539@fastcrypt.com> <45B3B9CB.3070308@kensystem.com> <3C6B3C20-CD94-4D35-B146-27DA78E6E462@fastcrypt.com> <45B40AE1.8020003@kensystem.com> <45B44726.1070301@kensystem.com> <45B480E6.2010009@gmx.at> In-Reply-To: Content-Type: text/plain; charset=KOI8-U Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=2.862 tagged_above=0 required=5 tests=BAYES_50, FROM_LOCAL_NOVOWEL X-Spam-Level: ** X-Archive-Number: 200701/144 X-Sequence-Number: 16509 Hello. I have few thoughts I'd like to share. Everything below is my IMHO. First of all, parsing input DDL (or requiring protocol support) is needed to get full support for all range of DDLS. But now PostgreSQL does not support this feature for any DLLs. Then you can always detect is the support is needed on the first user call - depending on which function is called to prepare/execute the statement. Why don't you want to do the next: For PreparedStatement *prepareStatement*(String sql, int[] columnIndexes) throws SQLException (ans similar Statement call) simply call sql + " RETURNING *" and then filter out column indexes Of course, this won't handle the case when statement already contains RETURNING, cases for non-INSERT and so on (I am not an expert to describe all possible cases). But now NO cases are working and this change will make some work properly and I, personally, don't see a problem in others giving some other error message (say, incorrect SQL text for statements already containing RETURNING) then they are doing now. When the protocol will be changed (extended), you can use that but what does prevent you to implement the most widely used (as for me) case, given it will be implemented properly?