pgsql: Improve support for composite types in PL/Python.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Improve support for composite types in PL/Python.
Date: 2014-07-03 20:10:55
Message-ID: E1X2nLL-0008Vc-Lc@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Improve support for composite types in PL/Python.

Allow PL/Python functions to return arrays of composite types.
Also, fix the restriction that plpy.prepare/plpy.execute couldn't
handle query parameters or result columns of composite types.

In passing, adopt a saner arrangement for where to release the
tupledesc reference counts acquired via lookup_rowtype_tupdesc.
The callers of PLyObject_ToCompositeDatum were doing the lookups,
but then the releases happened somewhere down inside subroutines
of PLyObject_ToCompositeDatum, which is bizarre and bug-prone.
Instead release in the same function that acquires the refcount.

Ed Behn and Ronan Dunklau, reviewed by Abhijit Menon-Sen

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/8b6010b8350a1756cd85595705971df81b5ffc07

Modified Files
--------------
doc/src/sgml/plpython.sgml | 7 -----
src/pl/plpython/expected/plpython_composite.out | 12 +++++---
src/pl/plpython/expected/plpython_spi.out | 15 ++++++++++
src/pl/plpython/expected/plpython_types.out | 13 ++++-----
src/pl/plpython/expected/plpython_types_3.out | 13 ++++-----
src/pl/plpython/plpy_exec.c | 2 ++
src/pl/plpython/plpy_spi.c | 7 +----
src/pl/plpython/plpy_typeio.c | 35 ++++++++++++-----------
src/pl/plpython/sql/plpython_composite.sql | 2 +-
src/pl/plpython/sql/plpython_spi.sql | 12 ++++++++
src/pl/plpython/sql/plpython_types.sql | 2 +-
11 files changed, 70 insertions(+), 50 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2014-07-03 22:26:15 pgsql: Redesign API presented by nodeAgg.c for ordered-set and similar
Previous Message Peter Eisentraut 2014-07-03 02:04:36 pgsql: Use a separate temporary directory for the Unix-domain socket