pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Luís Sousa <llsousa@ualg.pt>
To: pgsql-sql <pgsql-sql@postgresql.org>
Subject: Function returning SETOF using plpythonu
Date: Fri, 26 Jan 2007 17:24:52 +0000
Message-ID: <45BA3964.8070704@ualg.pt> (raw)

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





view thread (4+ messages)  latest in thread

Message-ID: <45BA3964.8070704@ualg.pt>
Permalink:  ../45BA3964.8070704@ualg.pt/
Also on:    postgresql.org/message-id/45BA3964.8070704@ualg.pt

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: llsousa@ualg.pt
  Subject: Re: Function returning SETOF using plpythonu
  In-Reply-To: <45BA3964.8070704@ualg.pt>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox