Re: OUT parameters in PL/Java

From: Thomas Hallgren <thhal(at)mailblocks(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: OUT parameters in PL/Java
Date: 2005-04-12 14:25:52
Message-ID: thhal-083I3A4VHySchqCIKpvwpFuaTVJ864B@mailblocks.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
> Thomas Hallgren <thhal(at)mailblocks(dot)com> writes:
>
>>I've read about changes in CVS head needed to accomodate OUT parameters.
>>I tried to compile PL/Java and it fails (of course). Is there any brief
>>text somewhere that highligts the changes that where made and explains
>>how the new stuff works? It's hard and somewhat time consuming to try to
>>deduct everything just by looking at the code in pl/pgsql.
>
>
> Could you give more details about what problem you are having? Simply
> recompiling an existing PL shouldn't fail (of course, it wouldn't know
> about OUT parameters either).
>
My compile failure was due to the change of proargtypes from Oid* to an
oidvector. I initially thought that had something to do with OUT parameters.

Some diffs on plperl helped me a bit. I found the new
get_call_result_type() function. I've made some assumptions that I would
like to verify the correctness of:

- I assume that by using the get_call_result_type() PL/Java will not
need any specific handling of functions returning OUT parameters since
they are similar to functions returning a complex type.

- The TupleDesc returned by the get_call_result_type() is not always
reachable using an Oid. I.e. I cannot use TypeGetTupleDesc(oid, NIL)
with the Form_pg_proc.prorettype of my function as the first argument.

- The Form_pg_proc.pronargs denotes the number of IN parameters, i.e.
its safe to access proargtypes.values[idx] with an idx ranging from 0 to
pronargs - 1.

Regards,
Thomas Hallgren

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2005-04-12 14:28:48 Re: HEAD version of initdb fails on Win32
Previous Message Tom Lane 2005-04-12 14:06:07 Re: OUT parameters in PL/Java