Re: strange bug in plperl

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, plperlng-devel(at)pgfoundry(dot)org
Subject: Re: strange bug in plperl
Date: 2004-07-05 16:28:32
Message-ID: 40E981B0.6040707@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:

>Andrew Dunstan <andrew(at)dunslane(dot)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.
>
>
>
>

Yep. I had come to that conclusion.

cheers

andrew

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2004-07-05 17:49:49 plperl security
Previous Message Tom Lane 2004-07-05 16:21:04 Re: strange bug in plperl