Re: Fwd: [JDBC] Weird issues when reading UDT from stored function - Mailing list pgsql-hackers

From Oliver Jowett
Subject Re: Fwd: [JDBC] Weird issues when reading UDT from stored function
Date
Msg-id 4D5BBD1A.7010005@opencloud.com
Whole thread Raw
In response to Re: Fwd: [JDBC] Weird issues when reading UDT from stored function  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: Fwd: [JDBC] Weird issues when reading UDT from stored function
Re: Fwd: [JDBC] Weird issues when reading UDT from stored function
List pgsql-hackers
On 17/02/11 00:58, Robert Haas wrote:
> On Wed, Feb 16, 2011 at 3:30 AM, Lukas Eder <lukas.eder@gmail.com> 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

pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Fwd: [JDBC] Weird issues when reading UDT from stored function
Next
From: strk
Date:
Subject: Re: DROP SCHEMA xxx CASCADE: ERROR: could not open relation with OID yyy