X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id E93309DCD76 for ; Thu, 1 Dec 2005 15:02:21 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 33949-02 for ; Thu, 1 Dec 2005 15:02:18 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from hosting.commandprompt.com (128.commandprompt.com [207.173.200.128]) by postgresql.org (Postfix) with ESMTP id 5D5339DCBF3 for ; Thu, 1 Dec 2005 15:02:18 -0400 (AST) Received: from [192.168.1.100] (or-67-76-146-141.sta.sprint-hsd.net [67.76.146.141]) (authenticated bits=0) by hosting.commandprompt.com (8.13.4/8.13.4) with ESMTP id jB1IuCQj012832; Thu, 1 Dec 2005 10:56:13 -0800 Message-ID: <438F48CE.7030008@commandprompt.com> Date: Thu, 01 Dec 2005 11:02:38 -0800 From: "Joshua D. Drake" User-Agent: Mozilla Thunderbird 1.0.7 (X11/20051013) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Eugene Prokopiev CC: pgsql-interfaces@postgresql.org Subject: Re: PL/Python set returning functions References: <438F47F7.2040109@stc.donpac.ru> In-Reply-To: <438F47F7.2040109@stc.donpac.ru> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Greylist: Sender succeded SMTP AUTH authentication, not delayed by milter-greylist-1.6 (hosting.commandprompt.com [192.168.1.101]); Thu, 01 Dec 2005 10:56:13 -0800 (PST) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0 required=5 tests=[none] X-Spam-Score: 0 X-Spam-Level: X-Archive-Number: 200512/2 X-Sequence-Number: 5870 Eugene Prokopiev wrote: > Hi, > > How can I return some rows from my PL/Python function? > > I wrote: > > dbmail=# create type composite as (id bigint, name text); > CREATE TYPE > dbmail=# create or replace function csrf() returns setof composite as $$ > dbmail$# return ((1, "james"), (2, "bob"), (3, "fargus")) > dbmail$# $$ language plpythonu; > CREATE FUNCTION > dbmail=# select csrf(); > ERROR: plpython functions cannot return tuples yet > select * from csrf(); > What's wrong? > > -- > Thanks, > Eugene Prokopiev > > ---------------------------(end of broadcast)--------------------------- > TIP 5: don't forget to increase your free space map settings -- The PostgreSQL Company - Command Prompt, Inc. 1.503.667.4564 PostgreSQL Replication, Consulting, Custom Development, 24x7 support Managed Services, Shared and Dedicated Hosting Co-Authors: PLphp, PLperl - http://www.commandprompt.com/