Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id D76E79FB446 for ; Wed, 27 Jun 2007 04:24:28 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 41786-08 for ; Wed, 27 Jun 2007 04:24:22 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from floppy.pyrenet.fr (news.pyrenet.fr [194.116.145.2]) by postgresql.org (Postfix) with ESMTP id B387E9FB488 for ; Wed, 27 Jun 2007 04:24:24 -0300 (ADT) Received: by floppy.pyrenet.fr (Postfix, from userid 106) id 655ED31439; Wed, 27 Jun 2007 09:24:23 +0200 (MET DST) From: "anoopmadavoor@gmail.com" X-Newsgroups: pgsql.interfaces Subject: How I can return a set of recordset from PL/Python Date: Wed, 27 Jun 2007 00:24:21 -0700 Organization: http://groups.google.com Lines: 26 Message-ID: <1182929061.446086.305950@w5g2000hsg.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Complaints-To: groups-abuse@google.com User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.11) Gecko/20070217 Iceape/1.0.8 (Debian-1.0.8-4),gzip(gfe),gzip(gfe) X-HTTP-Via: 1.1 core.com:3128 (squid/2.5.STABLE9), 1.0 Cyberoam-CACHE-Engine:3128 (squid/2.5.STABLE2) Complaints-To: groups-abuse@google.com Injection-Info: w5g2000hsg.googlegroups.com; posting-host=220.225.198.30; posting-account=RAUacA0AAADBxgK9YJezE5egfssgLyd7 To: pgsql-interfaces@postgresql.org X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=BAYES_50=0.001 X-Spam-Level: X-Archive-Number: 200706/15 X-Sequence-Number: 6584 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 as ' rv = plpy.execute("SELECT * FROM customer ) return ' 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