Function returning SETOF using plpythonu

From: Luís Sousa <llsousa(at)ualg(dot)pt>
To: pgsql-sql <pgsql-sql(at)postgresql(dot)org>
Subject: Function returning SETOF using plpythonu
Date: 2007-01-26 17:24:52
Message-ID: 45BA3964.8070704@ualg.pt
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi,

Is it possible to return rows from a function written in plpythonu using
SETOF?

Example:
CREATE FUNCTION "test_python_setof"()
RETURNS SETOF text AS '
records=plpy.execute("SELECT name FROM interface");
return records
' LANGUAGE 'plpythonu';

With this code is returning the object from the execution:
<PLyResult object at 0xb703e458>

Best regards,
Luís Sousa

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Bruno Wolff III 2007-01-26 20:11:24 Re: Intersection of two date interval
Previous Message Tom Lane 2007-01-26 14:57:32 Re: Using Temporary Tables in postgres functions