Re: PL/Python set returning functions

From: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
To: Eugene Prokopiev <prokopiev(at)stc(dot)donpac(dot)ru>
Cc: pgsql-interfaces(at)postgresql(dot)org
Subject: Re: PL/Python set returning functions
Date: 2005-12-01 19:02:38
Message-ID: 438F48CE.7030008@commandprompt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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/

In response to

Responses

Browse pgsql-interfaces by date

  From Date Subject
Next Message Ludek Finstrle 2005-12-01 19:59:32 Re: Data showing up as #Deleted in Access
Previous Message Eugene Prokopiev 2005-12-01 18:59:03 PL/Python set returning functions