Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 6D0971337BA1 for ; Thu, 17 Feb 2011 07:52:39 -0400 (AST) 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 27665-05; Thu, 17 Feb 2011 11:52:32 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail.softperience.eu (static-ip-217-118-26-141.inaddr.intergenia.de [217.118.26.141]) by mail.postgresql.org (Postfix) with ESMTP id F05741337B9D; Thu, 17 Feb 2011 07:52:31 -0400 (AST) Received: from mail.softperience.eu (static-ip-217-118-26-141.inaddr.intergenia.de [217.118.26.141]) by mail.softperience.eu (Postfix) with ESMTPA id 0002EC000B1; Thu, 17 Feb 2011 12:52:36 +0100 (CET) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Date: Thu, 17 Feb 2011 12:52:36 +0100 From: rsmogura To: Oliver Jowett Cc: Florian Pflug , Tom Lane , Robert Haas , Lukas Eder , , Subject: Re: Fwd: [JDBC] Weird issues when reading UDT from stored function In-Reply-To: <4D5D0A07.80706@opencloud.com> References: <4D5BBD1A.7010005@opencloud.com> <4D5BC65D.8070507@opencloud.com> <24907.1297869823@sss.pgh.pa.us> <4D5C6876.7060805@opencloud.com> <4D5CF52B.9020707@opencloud.com> <4D5D012E.8030707@opencloud.com> <90b9defedf07d3c3732025d140897b57@mail.softperience.eu> <4D5D0A07.80706@opencloud.com> Message-ID: X-Sender: rsmogura@softperience.eu User-Agent: Roundcube Webmail/0.5-rc X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-5 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201102/1661 X-Sequence-Number: 182450 On Fri, 18 Feb 2011 00:44:07 +1300, Oliver Jowett wrote: > On 18/02/11 00:37, rsmogura wrote: >> On Fri, 18 Feb 2011 00:06:22 +1300, Oliver Jowett wrote: >>> On 17/02/11 23:18, rsmogura wrote: >>>> Yes, but driver checks number of declared out parameters and >>>> number of >>>> resulted parameters (even check types of those), to prevent >>>> programming >>>> errors. >>> >>> And..? >>> >>> Oliver >> >> And it will throw exception when result will income. If you will >> remove >> this then you will lose check against programming errors, when >> number of >> expected parameters is different that number of actual parameters. >> Bear >> in mind that you will get result set of 6 columns, but only 1 is >> expected. I think you can't determine what should be returned and >> how to >> fix result without signature. > > You've completely missed the point. I am not suggesting we change > those > checks at all. I am suggesting we change how the JDBC driver > translates > call escapes to queries so that for N OUT parameters, we always get > exactly N result columns, without depending on the datatypes of the > parameters in any way. > > Oliver May You provide example select for this, and check behaviour with below procedure, too. CREATE OR REPLACE FUNCTION p_enhance_address3(OUT address u_address_type, OUT i1 integer) RETURNS record AS $BODY$ BEGIN SELECT t_author.address INTO address FROM t_author WHERE first_name = 'George'; i1 = 12; END; $BODY$ LANGUAGE plpgsql