How I can return a set of recordset from PL/Python - Mailing list pgsql-interfaces

From anoopmadavoor@gmail.com
Subject How I can return a set of recordset from PL/Python
Date
Msg-id 1182929061.446086.305950@w5g2000hsg.googlegroups.com
Whole thread Raw
List pgsql-interfaces
Hi,
     Anyone who have a knowledge about PL/Python pls help me. I want
to return a set of values from a database table.

I want to write PL/Python function like this


create or replace function cust_name(OUT temp) RETURNS SETOF
<something>  as '
rv = plpy.execute("SELECT * FROM customer )

return <the result obtained in rv>
' LANGUAGE plpythonu;

Sample data and table structure.

create table customer(id int,name text);
insert into customer values(1,'David John');
insert into customer values(2,'Richard Giri');

Thanks:

Anoop G



pgsql-interfaces by date:

Previous
From: Tom Lane
Date:
Subject: Re: libpq: PQexecParams, binaryFormat and float
Next
From: Richard Frankland
Date:
Subject: Re: libpq: PQexecParams, binaryFormat and float