X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id A8E6C3A5E0E for ; Sun, 5 Dec 2004 22:53:45 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 94881-10 for ; Sun, 5 Dec 2004 22:53:33 +0000 (GMT) Received: from smtp3.mailblocks.com (smtp.mailblocks.com [140.174.9.93]) by svr1.postgresql.org (Postfix) with SMTP id E48763A5E0B for ; Sun, 5 Dec 2004 22:53:35 +0000 (GMT) Received: (qmail 29745 invoked from network); 5 Dec 2004 22:53:35 -0000 Received: from 10.10.0.51 (HELO mailblocks.com) (10.10.0.51) by 10.10.0.93 with SMTP; 5 Dec 2004 22:53:35 -0000 MIME-Version: 1.0 To: Oliver Jowett Cc: Larry White , pgsql-jdbc@postgresql.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed References: <41B35CC6.2030800@mailblocks.com> <41B3663B.1010003@mailblocks.com> <41B37F31.1070205@opencloud.com> <41B39169.2060308@mailblocks.com> X-Accept-Language: en-us, en Content-Transfer-Encoding: 7bit Subject: Re: prepared statement call fails X-MB-Message-Source: ClientSMTP Received: from 82.182.133.12 by app2.mailblocks.com (192.168.225.51) with SMTP (authenticated); Sun, 05 Dec 2004 14:53:34 -0800 X-MB-Message-Type: User Message-Id: From: Thomas Hallgren In-Reply-To: <41B37F31.1070205@opencloud.com> Date: Sun, 05 Dec 2004 23:53:29 +0100 User-Agent: Mozilla Thunderbird 0.8 (Windows/20040913) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.433 tagged_above=0 required=5 tests=AWL, DNS_FROM_AHBL_RHSBL, DNS_FROM_RFC_ABUSE, FORGED_RCVD_HELO, RCVD_BY_IP X-Spam-Level: X-Archive-Number: 200412/30 X-Sequence-Number: 11696 Oliver Jowett wrote: > Please explain the difference between a PostgreSQL value-returning > function and a stored procedure that returns a value and takes no OUT > parameters. > > The {? = call ...} syntax is standard. I don't see any reason not to > map it to PostgreSQL functions for the cases that make sense. What will the JDBC driver do when PostgreSQL implements real stored procedures? If it maintains the current mapping for this syntax, it will not be able to call real procedures. If the mapping is changed to accomodate PERFORM, all current code that relies on this behavior will fail. There are also other differences. A CallableStatement should be prepared to accept multiple result set's as a return value, a CallableStatement might have multiple OUT parameters, and the auto commit semantics are different since stored procedures are allowed to start and end top level transactions. > If the server makes changes that are not backwards-compatible, of > course old drivers are going to break. But a) those sort of changes > are rare and b) the same argument holds true for *everything* in the > driver. In this case, the server will implement something that wasn't there before so there will not be any compatibility breakage. But since the JDBC driver use CallableStatement for something that it wasn't intended for, the special mapping it performs will become a problem now that the real thing exists. Then again, perhaps the behavior can be controlled by consulting the system tables and map according to that? It will take a roundtrip extra to figure out on the first call but that shouldn't be to big a deal. Regards, Thomas Hallgren