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

From rsmogura
Subject Re: Fwd: [JDBC] Weird issues when reading UDT from stored function
Date
Msg-id 0f6ba03b13a86472a2a8825bcf1c5811@mail.softperience.eu
Whole thread Raw
In response to Re: Fwd: [JDBC] Weird issues when reading UDT from stored function  (Lukas Eder <lukas.eder@gmail.com>)
List pgsql-hackers
 If I may give some suggestion, I was tried to investigate this, and
 maybe some this will help
 When you create procedure with out parameters then return type of this
 is implicit calculated and may be
 record or base type (if exactly one out param is defined).

 In many places I saw comparison of return type to recordoid or complex
 type, but check against complex type is through pg_types only, if
 typtype is marked 'c'. Unfortunately both rows and STRUCT (complex) has
 there 'c' - and this is OK for situation when procedure will return
 "table". But for complex types not being recordoid I think additional
 check should go. I mean to use get_rel_relkind() and e.g. check if it is
 pure complex type.

 By the way,
 Actually, based on above I saw funny things - I can create table with
 column type being other table :) And now If my one output parameter will
 be of complex type and relkind row type, what should I get?

 On Wed, 16 Feb 2011 09:30:43 +0100, 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.
>
> Cheers
> Lukas
>
> 2011/2/15 Robert Haas
>
>> On Sat, Feb 12, 2011 at 6:16 AM, Lukas Eder wrote:
>> > I had tried that before. That doesn't seem to change anything.
>> JDBC still
>> > expects 6 OUT parameters, instead of just 1...
>>
>> Oh, hrm.  I thought you were trying to fix the return value,
>> rather
>> than the signature.
>>
>> I am not sure how to fix the signature.  Can you just make it
>> return RECORD?
>>
>> --
>>
>> Robert Haas
>> EnterpriseDB: http://www.enterprisedb.com [2]
>> The Enterprise PostgreSQL Company
>
>
>
> Links:
> ------
> [1] mailto:lukas.eder@gmail.com
> [2] http://www.enterprisedb.com
> [3] mailto:robertmhaas@gmail.com


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Fwd: [JDBC] Weird issues when reading UDT from stored function
Next
From: Oliver Jowett
Date:
Subject: Re: Fwd: [JDBC] Weird issues when reading UDT from stored function