Enable pl/python to return records based on multiple OUT params

From: Hannu Krosing <hannu(at)2ndQuadrant(dot)com>
To: Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Enable pl/python to return records based on multiple OUT params
Date: 2008-11-01 04:13:30
Message-ID: 1225512810.8122.7.camel@huvostro
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

attached is a patch which enables plpython to recognize function with
multiple OUT params as returning a record

py=# create or replace function addsub( in i1 int, in i2 int,
py=# out o1 int, out o2 int) as
py=# $$
py$# return i1 + i2, i1-i2
py$# $$ language plpythonu;
CREATE FUNCTION
py=#
py=# select * from addsub(1,2);
o1 | o2
----+----
3 | -1
(1 row)

This version is quite rough, though passes tests here.

I will clean it up more during commitfest.

--
------------------------------------------
Hannu Krosing http://www.2ndQuadrant.com
PostgreSQL Scalability and Availability
Services, Consulting and Training

Attachment Content-Type Size
plpython.recout.diff text/x-patch 16.2 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ron Mayer 2008-11-01 04:42:23 Re: Re: Updated interval patches (SQL std output, ISO8601 intervals, and interval rounding)
Previous Message KaiGai Kohei 2008-11-01 00:47:25 Re: Please make sure your patches are on the wiki page