X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 24EA29DC849 for ; Thu, 15 Dec 2005 12:59:46 -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 44868-03 for ; Thu, 15 Dec 2005 12:59:44 -0400 (AST) X-Greylist: delayed 01:30:55.909647 by SQLgrey- Received: from nitrogenio.carvalhaes.net (nitrogenio.carvalhaes.net [200.175.206.51]) by postgresql.org (Postfix) with ESMTP id 560DC9DC820 for ; Thu, 15 Dec 2005 12:59:42 -0400 (AST) Received: from [200.175.206.50] (helo=[192.168.0.10]) by nitrogenio.carvalhaes.net with esmtpa (Exim 4.54) id 1EmwTR-00049h-Ne; Thu, 15 Dec 2005 15:01:01 -0200 Message-ID: <43A1A09D.6020708@carvalhaes.net> Date: Thu, 15 Dec 2005 14:58:05 -0200 From: grupos User-Agent: Thunderbird 1.5 (Windows/20051025) MIME-Version: 1.0 To: Richard Huxton CC: pgsql-sql@postgresql.org Subject: Re: RETURN SET OF DATA WITH CURSOR References: <43A18B25.1010705@carvalhaes.net> <43A193B4.5070206@archonet.com> In-Reply-To: <43A193B4.5070206@archonet.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Verificado contra virus. X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.583 required=5 tests=[AWL=0.583] X-Spam-Score: 0.583 X-Spam-Level: X-Archive-Number: 200512/132 X-Sequence-Number: 23674 Hi Richard, Thanks for your promptly answer. I don't have experience returning refcursor but my choice would be it. I read the documentation but I didn't find any example with my necessity... Could you give me a small example on the same "basis" that I want? Thanks, Rodrigo Carvalhaes Richard Huxton wrote: > grupos wrote: >> Hi ! >> >> I am making one plpgsql function and I need to return of setof data >> using a cursor. >> >> The problem is that my function is returning only the first row and >> column of the query. This query have more than 80 columns and 1.000 >> rows. Enyone have any tip to give me? > > Yes - decide whether you are returning a set of rows or a refcursor. > > Check the plpgsql docs again for how to return SETOF using the > RETURN NEXT statement. Then you call your function like: SELECT * FROM > my_func(); >