Re: [HACKERS] TODO request: multi-dimensional arrays in PL/pythonU

2013-08-15 Thread Josh Berkus
> There is no way to know how many dimensions the function expects to get > back. (float[][] doesn't actually mean anything.) So when converting > the return value back to SQL, you'd have to guess, is the first element > convertible to float (how do you know?), if not, does it support the > sequ

Re: [HACKERS] TODO request: multi-dimensional arrays in PL/pythonU

2013-08-15 Thread Claudio Freire
On Wed, Aug 14, 2013 at 9:34 PM, Peter Eisentraut wrote: > On Tue, 2013-08-13 at 14:30 -0700, Josh Berkus wrote: >> Currently PL/python has 1 dimension hardcoded for returning arrays: >> >> create or replace function nparr () >> returns float[][] >> language plpythonu >> as $f$ >> from numpy impor

Re: [HACKERS] TODO request: multi-dimensional arrays in PL/pythonU

2013-08-14 Thread Peter Eisentraut
On Tue, 2013-08-13 at 14:30 -0700, Josh Berkus wrote: > Currently PL/python has 1 dimension hardcoded for returning arrays: > > create or replace function nparr () > returns float[][] > language plpythonu > as $f$ > from numpy import array > x = ((1.0,2.0),(3.0,4.0),(5.0,6.0),) > return x > $f$;

[HACKERS] TODO request: multi-dimensional arrays in PL/pythonU

2013-08-13 Thread Josh Berkus
All, Currently PL/python has 1 dimension hardcoded for returning arrays: create or replace function nparr () returns float[][] language plpythonu as $f$ from numpy import array x = ((1.0,2.0),(3.0,4.0),(5.0,6.0),) return x $f$; josh=# select nparr() ; ERROR: invalid input syntax for type double