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-13 17:15:39
Message-ID: 425D53BB.4000508@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:
>
>
>>thhal=# create function javatest.recordExample(int, int) returns record
>>as 'org.postgresql.pljava.example.ComplexReturn.complexReturn' immutable
>>language java;
>>CREATE FUNCTION
>>thhal=# select * from javatest.recordExample(3, 4) as (foo int, bar int,
>>baz timestamptz);
>>ERROR: could not determine row description for function returning record
>>
>>
>
>Hmm. I think this is not your bug. Is the call coming from
>evaluate_function in clauses.c? We need to either prevent that from
>pre-evaluating a function returning RECORD, or fix it so it can pass
>the expected tuple descriptor ... probably the former :-(
>
>
Here's the stack backtrace when this happens.
#6 0xf5a104c3 in java_call_handler (fcinfo=0xfef8aba0)
at /home/thhal/work/org.postgresql.pljava/src/C/pljava/Backend.c:907
#7 0x08120358 in ExecMakeFunctionResult (fcache=0xa2623a8,
econtext=0xa262830, isNull=0xfef8ae1b "þ", isDone=0x0) at
execQual.c:1026
#8 0x0812261c in ExecEvalExprSwitchContext (expression=0x40,
econtext=0xa1ff75c, isNull=0xfef8ae1b "þ", isDone=0x0) at
execQual.c:2752
#9 0x0815fecf in evaluate_expr (expr=0xa2623a8, result_type=2249)
at clauses.c:2544
#10 0x08161a84 in simplify_function (funcid=17158, result_type=2249,
args=0xa25566c, allow_inline=1 '\001', context=0xfef8af30)
at clauses.c:2158
#11 0x08161f4f in eval_const_expressions_mutator (node=0xa254cfc,
context=0xfef8af30) at clauses.c:1301
#12 0x081629c0 in eval_const_expressions (node=0xa254cfc) at clauses.c:1207
#13 0x08158add in preprocess_expression (parse=0xa25420c, expr=0xa1ff75c,
kind=2) at planner.c:405
#14 0x0815a0c0 in subquery_planner (parse=0xa25420c, tuple_fraction=0)
at planner.c:275
#15 0x0815a23e in planner (parse=0xa25420c, isCursor=0 '\0',
cursorOptions=0,
boundParams=0x0) at planner.c:133
#16 0x0818e5fa in pg_plan_query (querytree=0xa25420c, boundParams=0x0)
at postgres.c:648
#17 0x0818e680 in pg_plan_queries (querytrees=0xa1ff75c, boundParams=0x0,
needSnapshot=0 '\0') at postgres.c:716
#18 0x081902ce in PostgresMain (argc=4, argv=0xa1ee71c,
username=0xa1ee6f4 "thhal") at postgres.c:875
#19 0x0816bc0a in ServerLoop () at postmaster.c:2784
#20 0x0816cfd7 in PostmasterMain (argc=3, argv=0xa1ed9e8) at
postmaster.c:917
#21 0x08138f1f in main (argc=3, argv=0xa1ed9e8) at main.c:268

Regards,
Thomas Hallgren

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Josh Berkus 2005-04-13 17:40:19 Re: Test coverage for external sorting
Previous Message Tom Lane 2005-04-13 14:01:41 Re: OUT parameters in PL/Java