Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id A11C91337B5C for ; Wed, 16 Feb 2011 08:04:10 -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 37944-05; Wed, 16 Feb 2011 12:04:03 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from tremor.opencloud.co.nz (tremor.opencloud.co.nz [131.203.101.230]) by mail.postgresql.org (Postfix) with ESMTP id AFA6B13364DE; Wed, 16 Feb 2011 08:04:02 -0400 (AST) Received: from 121-98-80-66.bitstream.orcon.net.nz ([121.98.80.66] helo=[192.168.1.2]) by tremor.opencloud.co.nz with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1Ppg6o-0006T9-VV; Thu, 17 Feb 2011 01:03:51 +1300 Message-ID: <4D5BBD1A.7010005@opencloud.com> Date: Thu, 17 Feb 2011 01:03:38 +1300 From: Oliver Jowett User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101208 Thunderbird/3.1.7 MIME-Version: 1.0 To: Robert Haas CC: Lukas Eder , rsmogura , pgsql-jdbc@postgresql.org, pgsql-hackers@postgresql.org Subject: Re: Fwd: [JDBC] Weird issues when reading UDT from stored function References: <201101111946.33083.rsmogura@softperience.eu> <4d7cc4033a655539995c240a6f282ab5@mail.softperience.eu> <4D33CD00.6000408@opencloud.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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/1507 X-Sequence-Number: 182296 On 17/02/11 00:58, Robert Haas wrote: > On Wed, Feb 16, 2011 at 3:30 AM, Lukas Eder wrote: >> I'm not trying to fix the signature. I want exactly that signature. I want >> to return 1 UDT as an OUT parameter from a function. >> >> Somewhere between JDBC and the database, this signature is lost, and JDBC's >> internal code tells me that I have to bind 6 OUT parameters, instead of 1. >> It happens to be so, because the UDT contains 6 attributes, so somehow the >> JDBC/database protocol flattens the UDT, and I think that's a bug, either in >> JDBC or in the protocol or in the database. My findings were that I can >> correctly read the UDT OUT parameter using the pgAdmin III tool, so I >> excluded the database as a bug holder candidate. > > Oh, OK. Sorry, I can't help you any with the JDBC side... Well, the underlying problem is that "SELECT * from function_with_one_out_parameter()" is returning *6* columns, not 1 column. I don't know if that's expected or not on the plpgsql side, but the JDBC driver has no way of distinguishing that sort of result from a function that has 6 OUT parameters. Oliver