Atached patch fix the problem.
Serg
Andrew Dunstan wrote:
Can anyone suggest why I might be seeing this effect (each notice
comes out once per row plus once per function call)
thanks
andrew
andrew=# create function tstset() returns setof tst language plperl as $$
andrew$# elog(NOTICE,"tstset call
I just reproduced this problem when returning
a composite and NOT as SETOF composite.
An assumption is being made that if the return
value is a composite, that it must be part of a set.
This is incorrect.
Test case available on request--if you don't have
one already.
Spoke with Andrew wrt on #po
Tom Lane wrote:
Andrew Dunstan <[EMAIL PROTECTED]> writes:
Can anyone suggest why I might be seeing this effect (each notice comes
out once per row plus once per function call)
It looks like you're executing the whole function body once per physical
call, which is certainly not a good pla
Andrew Dunstan <[EMAIL PROTECTED]> writes:
> Can anyone suggest why I might be seeing this effect (each notice comes
> out once per row plus once per function call)
It looks like you're executing the whole function body once per physical
call, which is certainly not a good plan for a function ret
OK, thanks. I see where the problem is. We'll fix the SRF code.
cheers
andrew
Darko Prenosil wrote:
Because that is exactly count of "tstset" function being called. Set returning
functions are called recursively until SRF_RETURN_DONE is returned, and that
in You case means until last row is fetch
Because that is exactly count of "tstset" function being called. Set returning
functions are called recursively until SRF_RETURN_DONE is returned, and that
in You case means until last row is fetched.
When You programming functions in "C", there is SRF_ISFIRST_CALL function that
returns "true"
Can anyone suggest why I might be seeing this effect (each notice comes
out once per row plus once per function call)
thanks
andrew
andrew=# create function tstset() returns setof tst language plperl as $$
andrew$# elog(NOTICE,"tstset called");
andrew$# return [{i=>1,v=>"one"},{i=>2,v=>"two"}];
a