pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: rsmogura <rsmogura@softperience.eu>
To: Lukas Eder <lukas.eder@gmail.com>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Oliver Jowett <oliver@opencloud.com>
Cc: pgsql-jdbc@postgresql.org
Cc: pgsql-hackers@postgresql.org
Subject: Re: Fwd: [JDBC] Weird issues when reading UDT from stored function
Date: Wed, 16 Feb 2011 13:12:22 +0100
Message-ID: <0f6ba03b13a86472a2a8825bcf1c5811@mail.softperience.eu> (raw)
In-Reply-To: <AANLkTikNjPoca5n7CusTEL2GoXNQuZeeF0vyegpsz3UF@mail.gmail.com>
References: <c63c0e3d-cd3b-4b82-b891-50f8ef43bfdb@j25g2000vbs.googlegroups.com>
	<AANLkTi=HC-C5gL29ovNqcqtfNQa6XM8oNA0a86YsYcVt@mail.gmail.com>
	<AANLkTi=pTFGV+vVFgKwB6+ZNWb+r9LrYpJXKEytL5P02@mail.gmail.com>
	<201101111946.33083.rsmogura@softperience.eu>
	<AANLkTi=UH_9qC8CmQBN7aEwsdUMYAzjRUCJmDiWFTQQH@mail.gmail.com>
	<4d7cc4033a655539995c240a6f282ab5@mail.softperience.eu>
	<AANLkTi=EAbWpOZhXUaG0OG7smtExwoE4M9dv2ykzPVcZ@mail.gmail.com>
	<4D33CD00.6000408@opencloud.com>
	<AANLkTin_UwaAjVKOqY3ZGpHtEt4WiX8f-ERJhA16JWX+@mail.gmail.com>
	<AANLkTimvqQmkvG0QcruFGGxCrQ63U8srtDtMZBH8WjQU@mail.gmail.com>
	<AANLkTi=Nf_eqY0Ao1W41rMc4vp-B6+8j+AENJ2x-qJ--@mail.gmail.com>
	<AANLkTikWLBniH-QRKa0AL+O71+DnTyizn770Hd89d5Lu@mail.gmail.com>
	<AANLkTi=0KS71rnnLjFrQ4G8VaOXsbYqndbmLStwL9aRt@mail.gmail.com>
	<AANLkTikNjPoca5n7CusTEL2GoXNQuZeeF0vyegpsz3UF@mail.gmail.com>

 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




view thread (48+ messages)  latest in thread

Message-ID: <0f6ba03b13a86472a2a8825bcf1c5811@mail.softperience.eu>
Permalink:  ../0f6ba03b13a86472a2a8825bcf1c5811@mail.softperience.eu/
Also on:    postgresql.org/message-id/0f6ba03b13a86472a2a8825bcf1c5811@mail.softperience.eu

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: rsmogura@softperience.eu, lukas.eder@gmail.com, robertmhaas@gmail.com, oliver@opencloud.com, pgsql-hackers@postgresql.org
  Subject: Re: Fwd: [JDBC] Weird issues when reading UDT from stored function
  In-Reply-To: <0f6ba03b13a86472a2a8825bcf1c5811@mail.softperience.eu>
  References: <c63c0e3d-cd3b-4b82-b891-50f8ef43bfdb@j25g2000vbs.googlegroups.com> <AANLkTi=HC-C5gL29ovNqcqtfNQa6XM8oNA0a86YsYcVt@mail.gmail.com> <AANLkTi=pTFGV+vVFgKwB6+ZNWb+r9LrYpJXKEytL5P02@mail.gmail.com> <201101111946.33083.rsmogura@softperience.eu> <AANLkTi=UH_9qC8CmQBN7aEwsdUMYAzjRUCJmDiWFTQQH@mail.gmail.com> <4d7cc4033a655539995c240a6f282ab5@mail.softperience.eu> <AANLkTi=EAbWpOZhXUaG0OG7smtExwoE4M9dv2ykzPVcZ@mail.gmail.com> <4D33CD00.6000408@opencloud.com> <AANLkTin_UwaAjVKOqY3ZGpHtEt4WiX8f-ERJhA16JWX+@mail.gmail.com> <AANLkTimvqQmkvG0QcruFGGxCrQ63U8srtDtMZBH8WjQU@mail.gmail.com> <AANLkTi=Nf_eqY0Ao1W41rMc4vp-B6+8j+AENJ2x-qJ--@mail.gmail.com> <AANLkTikWLBniH-QRKa0AL+O71+DnTyizn770Hd89d5Lu@mail.gmail.com> <AANLkTi=0KS71rnnLjFrQ4G8VaOXsbYqndbmLStwL9aRt@mail.gmail.com> <AANLkTikNjPoca5n7CusTEL2GoXNQuZeeF0vyegpsz3UF@mail.gmail.com> <0f6ba03b13a86472a2a8825bcf1c5811@mail.softperience.eu>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox