Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id BB3E69FA589 for ; Fri, 26 Jan 2007 13:25:03 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-new, port 10024) with ESMTP id 14678-02 for ; Fri, 26 Jan 2007 13:24:59 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from smtp3.ualg.pt (smtp3.ualg.pt [193.136.224.6]) by postgresql.org (Postfix) with ESMTP id 4DAFC9FA385 for ; Fri, 26 Jan 2007 13:24:59 -0400 (AST) Received: by smtp3.ualg.pt (Postfix, from userid 501) id 8CFA01E1A42; Fri, 26 Jan 2007 17:24:55 +0000 (WET) Received: from localhost (smtp3.ualg.pt [127.0.0.1]) by smtp3.ualg.pt (Postfix) with ESMTP id 75E4C1E1A2C for ; Fri, 26 Jan 2007 17:24:55 +0000 (WET) X-Virus-Scanned: amavisd-new at ualg.pt Received: from smtp3.ualg.pt ([127.0.0.1]) by localhost (smtp3.ualg.pt [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id S1R+HO8mVleg for ; Fri, 26 Jan 2007 17:24:54 +0000 (WET) Received: from [10.17.20.14] (unknown [10.17.20.14]) by smtp3.ualg.pt (Postfix) with ESMTP id BA5751E19A9 for ; Fri, 26 Jan 2007 17:24:54 +0000 (WET) Message-ID: <45BA3964.8070704@ualg.pt> Date: Fri, 26 Jan 2007 17:24:52 +0000 From: =?ISO-8859-1?Q?Lu=EDs_Sousa?= User-Agent: Debian Thunderbird 1.0.2 (X11/20061113) X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-sql Subject: Function returning SETOF using plpythonu Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.391 tagged_above=0 required=5 tests=AWL, BAYES_50, SPF_PASS X-Spam-Level: X-Archive-Number: 200701/142 X-Sequence-Number: 27294 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: Best regards, Luís Sousa