Re: plpython returns integer[] fails for multi-dimensional array

From: Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Cc: Peter Geoghegan <peter(dot)geoghegan86(at)gmail(dot)com>, Thom Brown <thom(at)linux(dot)com>, "TJ O'Donnell" <tjo(at)acm(dot)org>
Subject: Re: plpython returns integer[] fails for multi-dimensional array
Date: 2010-12-22 00:02:22
Message-ID: 201012211602.22492.adrian.klaver@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tuesday 21 December 2010 3:25:48 pm Peter Geoghegan wrote:
> On 21 December 2010 23:17, Thom Brown <thom(at)linux(dot)com> wrote:
> > Are you sure that "a" returns okay in that scenario. You're using a
> > list. Shouldn't you be using an array? Like: a = []
>
> a =[] actually declares an empty list in Python. You can return a list
> or a tuple from a pl/python function in 9.0 and it will be interpreted
> as an array at the SQL call site. You cannot in prior versions.
>
> --
> Regards,
> Peter Geoghegan

Digging into the source for plpython seems to show it only supports one
dimensional arrays. When I tried my previous example on a 9.0.1 instance it
kept changing integer[][] to integer[].

--
Adrian Klaver
adrian(dot)klaver(at)gmail(dot)com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Merlin Moncure 2010-12-22 00:03:52 Re: libpq sendQuery -- getResult not returning until all queries complete
Previous Message Tom Lane 2010-12-21 23:49:03 Re: libpq sendQuery -- getResult not returning until all queries complete