Re: PL/Perl list value return causes segfault

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: David Fetter <david(at)fetter(dot)org>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Michael Fuhr <mike(at)fuhr(dot)org>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: PL/Perl list value return causes segfault
Date: 2005-07-30 03:24:37
Message-ID: 200507300324.j6U3Ob713189@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs pgsql-hackers pgsql-patches


Would someone who knows perl update plperl.sgml and send me a patch?

Also, is this still true in 8.1:

In the current implementation, if you are fetching or returning
very large data sets, you should be aware that these will all go
into memory.

---------------------------------------------------------------------------

Andrew Dunstan wrote:
>
>
> David Fetter wrote:
>
> >On Tue, Jul 12, 2005 at 03:45:55PM -0400, Andrew Dunstan wrote:
> >
> >
> >>
> >>In perl, if there is any ambiguity it is the called function that is
> >>responsible for checking, not the caller. See "perldoc -f
> >>wantarray". PLPerl explicitly passed G_SCALAR as a flag on all
> >>calls to plperl routines. So returning a list is a case of pilot
> >>error.
> >>
> >>
> >
> >Is this a kind of pilot error that documents could help avert in some
> >useful way?
> >
> >
> >
> >
>
> Sure. "A plperl function must always return a scalar value.More complex
> structures (arrays, records, and sets) can be returned in the
> appropriate context by returning a reference. A list should never be
> returned." Salt to taste and insert where appropriate.
>
> cheers
>
> andrew
>
> ---------------------------(end of broadcast)---------------------------
> TIP 9: In versions below 8.0, the planner will ignore your desire to
> choose an index scan if your joining column's datatypes do not
> match
>

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message David Fetter 2005-07-30 05:43:54 Re: [HACKERS] PL/Perl list value return causes segfault
Previous Message Alvaro Herrera 2005-07-30 03:21:15 Re: current_schemas()

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2005-07-30 03:49:32 Re: bgwriter, inherited temp tables TODO items?
Previous Message Bruce Momjian 2005-07-30 03:21:19 Re: Vacuum summary?

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2005-07-30 03:39:43 Re: AIX FAQ Updates
Previous Message Kevin McArthur 2005-07-30 02:39:36 Re: INSERT ... RETURNING