Re: PL/Python array support

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Teodor Sigaev <teodor(at)sigaev(dot)ru>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: PL/Python array support
Date: 2009-11-19 22:00:24
Message-ID: 1258668024.26726.16.camel@vanquo.pezone.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On fre, 2009-11-13 at 18:46 +0300, Teodor Sigaev wrote:
> CREATE OR REPLACE FUNCTION incr(stuff int[]) RETURNS int[] AS $$
> for x in stuff:
> yield x+1
> $$
> LANGUAGE 'plpythonu';
>
> # select incr(ARRAY[1,2,3]);
> ERROR: invalid memory alloc request size 18446744073709551608
> CONTEXT: while creating return value
> PL/Python function "incr"

Fixed with additional error check and regression test. (The problem
could be more simply demonstrated by returning any non-sequence from the
function.) Thanks for catching it.

Attachment Content-Type Size
plpython-arrays.patch text/x-patch 12.5 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Joachim Wieland 2009-11-19 22:04:07 Re: Listen / Notify - what to do when the queue is full
Previous Message Andrew Dunstan 2009-11-19 21:47:36 Re: Union test case broken in make check?