Re: OUT parameters in PL/Java - Mailing list pgsql-hackers

From Thomas Hallgren
Subject Re: OUT parameters in PL/Java
Date
Msg-id 425D53BB.4000508@mailblocks.com
Whole thread Raw
In response to Re: OUT parameters in PL/Java  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane wrote:

>Thomas Hallgren <thhal@mailblocks.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




pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: OUT parameters in PL/Java
Next
From: Josh Berkus
Date:
Subject: Re: Test coverage for external sorting