From: | elein <elein(at)varlena(dot)com> |
---|---|
To: | Andrew Dunstan <andrew(at)dunslane(dot)net> |
Cc: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, plperlng-devel(at)pgfoundry(dot)org |
Subject: | Re: strange bug in plperl |
Date: | 2004-07-05 22:01:04 |
Message-ID: | 20040705150104.T21709@cookie.varlena.com |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
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 #postgresql.
--elein
On Mon, Jul 05, 2004 at 12:28:32PM -0400, Andrew Dunstan wrote:
>
>
> 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
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org
From | Date | Subject | |
---|---|---|---|
Next Message | Andrew Dunstan | 2004-07-05 22:03:21 | Re: plperl security |
Previous Message | Tom Lane | 2004-07-05 21:58:05 | Re: plperl security |