BUG #5171: Composite type with array does not translate in plpythonu

Started by Jasonover 16 years ago5 messagesbugs
Jump to latest
#1Jason
jason@beanfield.com

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

#2Peter Eisentraut
peter_e@gmx.net
In reply to: Jason (#1)
Re: BUG #5171: Composite type with array does not translate in plpythonu

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.

#3Robert Haas
robertmhaas@gmail.com
In reply to: Peter Eisentraut (#2)
Re: BUG #5171: Composite type with array does not translate 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

#4Peter Eisentraut
peter_e@gmx.net
In reply to: Robert Haas (#3)
Re: BUG #5171: Composite type with array does not translate in plpythonu

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.

#5Peter Eisentraut
peter_e@gmx.net
In reply to: Peter Eisentraut (#2)
Re: BUG #5171: Composite type with array does not translate in plpythonu

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 ... ;-)