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.e...@gmail.com
[2] http://www.enterprisedb.com
[3] mailto:robertmh...@gmail.com


--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to