Function returning SETOF using plpythonu - Mailing list pgsql-sql

From Luís Sousa
Subject Function returning SETOF using plpythonu
Date
Msg-id 45BA3964.8070704@ualg.pt
Whole thread Raw
List 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




pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: Using Temporary Tables in postgres functions
Next
From: Bruno Wolff III
Date:
Subject: Re: Intersection of two date interval