Re: strange bug in plperl - Mailing list pgsql-hackers

From Tom Lane
Subject Re: strange bug in plperl
Date
Msg-id 1812.1089044464@sss.pgh.pa.us
Whole thread Raw
In response to strange bug in plperl  (Andrew Dunstan <andrew@dunslane.net>)
Responses Re: strange bug in plperl  (Andrew Dunstan <andrew@dunslane.net>)
List pgsql-hackers
Andrew Dunstan <andrew@dunslane.net> 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 returning set.
Once you get to the RETURN statement, you probably want to stash away
the array value and then just return elements of it on successive calls,
without reexecuting any user code.
        regards, tom lane


pgsql-hackers by date:

Previous
From: "Jeroen T. Vermeulen"
Date:
Subject: Re: [Re] Re: PREPARE and transactions
Next
From: Andrew Dunstan
Date:
Subject: Re: strange bug in plperl