X-Original-To: pgsql-hackers-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id ED76052A00 for ; Sat, 30 Jul 2005 00:24:49 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 27028-05 for ; Sat, 30 Jul 2005 03:24:41 +0000 (GMT) Received: from candle.pha.pa.us (candle.pha.pa.us [64.139.89.126]) by svr1.postgresql.org (Postfix) with ESMTP id C5DFC529DD for ; Sat, 30 Jul 2005 00:24:40 -0300 (ADT) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.11.6) id j6U3Ob713189; Fri, 29 Jul 2005 23:24:37 -0400 (EDT) From: Bruce Momjian Message-Id: <200507300324.j6U3Ob713189@candle.pha.pa.us> Subject: Re: PL/Perl list value return causes segfault In-Reply-To: <42D44731.90306@dunslane.net> To: Andrew Dunstan Date: Fri, 29 Jul 2005 23:24:37 -0400 (EDT) Cc: David Fetter , Alvaro Herrera , Michael Fuhr , pgsql-hackers@postgresql.org X-Mailer: ELM [version 2.4ME+ PL121 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.01 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200507/1098 X-Sequence-Number: 71150 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@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073