aboutsummaryrefslogtreecommitdiff
path: root/src/pl/plpython/plpy_spi.c
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2012-01-30 21:38:52 +0200
committerPeter Eisentraut <peter_e@gmx.net>2012-01-30 21:38:52 +0200
commitee7fa66b19f5454fac07caee4b7798810b579a82 (patch)
tree2cb224c8f99c3626f562f14fa7aa9b6990465010 /src/pl/plpython/plpy_spi.c
parentc6ea8ccea6bf23501962ddc7ac9ffdb99c8643e1 (diff)
downloadpostgresql-ee7fa66b19f5454fac07caee4b7798810b579a82.tar.gz
postgresql-ee7fa66b19f5454fac07caee4b7798810b579a82.zip
PL/Python: Add result metadata functions
Add result object functions .colnames, .coltypes, .coltypmods to obtain information about the result column names and types, which was previously not possible in the PL/Python SPI interface. reviewed by Abhijit Menon-Sen
Diffstat (limited to 'src/pl/plpython/plpy_spi.c')
-rw-r--r--src/pl/plpython/plpy_spi.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/pl/plpython/plpy_spi.c b/src/pl/plpython/plpy_spi.c
index 3afb1093d57..0d63c4f5ce8 100644
--- a/src/pl/plpython/plpy_spi.c
+++ b/src/pl/plpython/plpy_spi.c
@@ -398,6 +398,8 @@ PLy_spi_execute_fetch_result(SPITupleTable *tuptable, int rows, int status)
oldcontext = CurrentMemoryContext;
PG_TRY();
{
+ result->tupdesc = CreateTupleDescCopy(tuptable->tupdesc);
+
if (rows)
{
Py_DECREF(result->rows);