Обсуждение: BUG #5171: Composite type with array does not translate in plpythonu
The following bug has been logged online:
Bug reference: 5171
Logged by: Jason
Email address: jason@beanfield.com
PostgreSQL version: 8.4
Operating system: FreeBSD
Description: Composite type with array does not translate in
plpythonu
Details:
When I have a plpythonu function returning a composite type that has an
array column, the function does not work when I try to return a list for
that column.
create type test_array as (
col1 text[]
);
create function return_array(val1 text, val2 text) returns test_array
as $$
return {'col1': [val1, val2]}
$$ language plpythonu;
select return_array('test1','test2')
ERROR: missing dimension value
********** Error **********
ERROR: missing dimension value
SQL state: 22P02
On fre, 2009-11-06 at 17:29 +0000, Jason wrote: > When I have a plpythonu function returning a composite type that has an > array column, the function does not work when I try to return a list for > that column. There is a patch proposed to address that in 8.5, but before that, arrays are pretty much not supported in plpythonu.
On Sat, Nov 7, 2009 at 5:23 AM, Peter Eisentraut <peter_e@gmx.net> wrote: > On fre, 2009-11-06 at 17:29 +0000, Jason wrote: >> When I have a plpythonu function returning a composite type that has an >> array column, the function does not work when I try to return a list for >> that column. > > There is a patch proposed to address that in 8.5, but before that, > arrays are pretty much not supported in plpythonu. Is this at all related to bug #5128? ...Robert
On Sun, 2009-11-08 at 16:33 -0500, Robert Haas wrote: > On Sat, Nov 7, 2009 at 5:23 AM, Peter Eisentraut <peter_e@gmx.net> wrote: > > On fre, 2009-11-06 at 17:29 +0000, Jason wrote: > >> When I have a plpythonu function returning a composite type that has an > >> array column, the function does not work when I try to return a list for > >> that column. > > > > There is a patch proposed to address that in 8.5, but before that, > > arrays are pretty much not supported in plpythonu. > > Is this at all related to bug #5128? It's in the same area, but fixing one won't fix the other, I think.
On lör, 2009-11-07 at 12:23 +0200, Peter Eisentraut wrote: > On fre, 2009-11-06 at 17:29 +0000, Jason wrote: > > When I have a plpythonu function returning a composite type that has an > > array column, the function does not work when I try to return a list for > > that column. > > There is a patch proposed to address that in 8.5, but before that, > arrays are pretty much not supported in plpythonu. Btw., I just checked out your example against said patch and it works. So something to look forward to ... ;-)