Re: PL/Python set returning functions - Mailing list pgsql-interfaces

From Joshua D. Drake
Subject Re: PL/Python set returning functions
Date
Msg-id 438F48CE.7030008@commandprompt.com
Whole thread Raw
In response to PL/Python set returning functions  (Eugene Prokopiev <prokopiev@stc.donpac.ru>)
Responses Re: PL/Python set returning functions  (Michael Fuhr <mike@fuhr.org>)
List pgsql-interfaces
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/



pgsql-interfaces by date:

Previous
From: Eugene Prokopiev
Date:
Subject: PL/Python set returning functions
Next
From: Michael Fuhr
Date:
Subject: Re: PL/Python set returning functions