PL/Python flattens composite types to string? - Mailing list pgsql-general

From Steve White
Subject PL/Python flattens composite types to string?
Date
Msg-id 20100109104435.GA17534@cashmere.aip.de
Whole thread Raw
List pgsql-general
Hi,

I recently wrote PL/Python code that worked on fields of composite types.

The plpy.execute() command on a SELECT returns a list of nice dictionaries
keyed on field names, containing the fields.  For numeric types, the type
of the dictionary values are as expected.  To my chagrin however, if a
field contains a composite type, it is flattened to a string.

I would have expected a composite type field to be returned as a dictionary
of values of the proper types, keyed on the names of the elements of the
composite type.

I was able to work around this problem in an ugly way, but I can imaging
cases where this would render plpy unsuitable.

I see nothing in the documentation about this
    http://www.postgresql.org/docs/8.4/static/plpython.html
It only talks about passing composite types into and out of functions.

Is this a bug?  This is psql v. 8.1.18 on one machine, and 8.4.1 on another.

Am I somehow doing it wrong?
    -- See attached test

Cheers!

--
| -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -
| Steve White                                             +49(331)7499-202
| e-Science / AstroGrid-D                                   Zi. 35  Bg. 20
| -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -
| Astrophysikalisches Institut Potsdam (AIP)
| An der Sternwarte 16, D-14482 Potsdam
|
| Vorstand: Prof. Dr. Matthias Steinmetz, Peter A. Stolz
|
| Stiftung privaten Rechts, Stiftungsverzeichnis Brandenburg: III/7-71-026
| -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -

Attachment

pgsql-general by date:

Previous
From: Anisha Kaul
Date:
Subject: pgsql2shp usage
Next
From: José María Terry Jiménez
Date:
Subject: Re: pgadmin save password