Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 26DD31337C10 for ; Thu, 17 Feb 2011 06:18:45 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 22836-01-2; Thu, 17 Feb 2011 10:18:37 +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 72A4E1337BD8; Thu, 17 Feb 2011 06:18:12 -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 D5DE2C000B1; Thu, 17 Feb 2011 11:18:17 +0100 (CET) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Date: Thu, 17 Feb 2011 11:18:17 +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: <4D5CF52B.9020707@opencloud.com> References: <4d7cc4033a655539995c240a6f282ab5@mail.softperience.eu> <4D33CD00.6000408@opencloud.com> <4D5BBD1A.7010005@opencloud.com> <4D5BC65D.8070507@opencloud.com> <24907.1297869823@sss.pgh.pa.us> <4D5C6876.7060805@opencloud.com> <4D5CF52B.9020707@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/1648 X-Sequence-Number: 182437 Yes, but driver checks number of declared out parameters and number of resulted parameters (even check types of those), to prevent programming errors. On Thu, 17 Feb 2011 23:15:07 +1300, Oliver Jowett wrote: > Florian Pflug wrote: >> On Feb17, 2011, at 01:14 , Oliver Jowett wrote: >>> Any suggestions about how the JDBC driver can express the query to >>> get >>> the behavior that it wants? Specifically, the driver wants to call >>> a >>> particular function with N OUT or INOUT parameters (and maybe some >>> other >>> IN parameters too) and get a resultset with N columns back. >> There's no sane way to do that, I fear. You could of course look up >> the >> function definition in the catalog before actually calling it, but >> with >> overloading and polymorphic types finding the right pg_proc entry >> seems >> awfully complex. >> Your best option is probably to just document this caveat... > > Well, the JDBC driver does know how many OUT parameters there are > before execution happens, so it could theoretically do something > different for 1 OUT vs. many OUT parameters. > > The problem is that currently the translation of the JDBC "{ call }" > escape happens early on, well before we know which parameters are OUT > parameters. Moving that translation later is, at best, tricky, so I > was hoping there was one query form that would handle all cases. > > Oliver