public inbox for [email protected]  
help / color / mirror / Atom feed
From: Bruce Momjian <[email protected]>
To: Andrew Dunstan <[email protected]>
Cc: David Fetter <[email protected]>
Cc: Alvaro Herrera <[email protected]>
Cc: Michael Fuhr <[email protected]>
Cc: [email protected]
Subject: Re: PL/Perl list value return causes segfault
Date: Fri, 29 Jul 2005 23:24:37 -0400 (EDT)
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>


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
  [email protected]               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073



view thread (13+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: PL/Perl list value return causes segfault
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox