Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Yyc1z-0002xZ-Jy for pgsql-jdbc@arkaria.postgresql.org; Sat, 30 May 2015 08:22:11 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Yyc1z-00028S-3r for pgsql-jdbc@arkaria.postgresql.org; Sat, 30 May 2015 08:22:11 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Yyc1y-00026q-9S for pgsql-jdbc@postgresql.org; Sat, 30 May 2015 08:22:10 +0000 Received: from plane.gmane.org ([80.91.229.3]) by makus.postgresql.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1Yyc1u-0001ef-Nl for pgsql-jdbc@postgresql.org; Sat, 30 May 2015 08:22:09 +0000 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Yyc1r-0005dd-8b for pgsql-jdbc@postgresql.org; Sat, 30 May 2015 10:22:03 +0200 Received: from ppp-46-244-249-91.dynamic.mnet-online.de ([46.244.249.91]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 30 May 2015 10:22:03 +0200 Received: from spam_eater by ppp-46-244-249-91.dynamic.mnet-online.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 30 May 2015 10:22:03 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-jdbc@postgresql.org From: Thomas Kellerer Subject: CallableStatement.getParameterMetaData() throws exception for valid {call ...} statement Date: Sat, 30 May 2015 10:21:52 +0200 Lines: 50 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: ppp-46-244-249-91.dynamic.mnet-online.de User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.21) Gecko/20090302 Thunderbird/2.0.0.21 Mnenhy/0.7.5.666 X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-jdbc Precedence: bulk Sender: pgsql-jdbc-owner@postgresql.org Hello, I just noticed the following: Using this sample function from the manual: CREATE FUNCTION sum_n_product(x int, y int, OUT sum int, OUT prod int) AS $$ BEGIN sum := x + y; prod := x * y; END; $$ LANGUAGE plpgsql; When calling this through JDBC, the following works without problems: cstmt = connection.prepareCall("{call sum_n_product(?,?,?,?)}"); cstmt.registerOutParameter(3, Types.INTEGER); cstmt.registerOutParameter(4, Types.INTEGER); cstmt.setInt(1, 2); cstmt.setInt(2, 5); cstmt.execute(); int x1 = cstmt.getInt(3); int x2 = cstmt.getInt(4); System.out.println("x1: " + x1); System.out.println("x2: " + x2); However when calling ParameterMetaData meta = cstmt.getParameterMetaData(); after prepareCall() the following exception is thrown: org.postgresql.util.PSQLException: ERROR: function sum_n_product(unknown, unknown, unknown, unknown) does not exist Hint: No function matches the given name and argument types. You might need to add explicit type casts. Position: 15 Casting everything to integer ( "{call sum_n_product(?::int,?::int,?::int,?::int)}" ) produces the same error (except that the parameter list shows integer in the exception message). This looks like a bug to me. Why should getParameterMetaData() throw an exception if the call is valid and working? Driver version is 9.4-1200 Postgres version is 9.4.2 Java version is 1.7.0_55 Regards Thomas -- Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-jdbc