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 468A79DC812 for ; Thu, 15 Dec 2005 12:03:04 -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 31629-02 for ; Thu, 15 Dec 2005 12:03:02 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mail.metronet.co.uk (mail.metronet.co.uk [213.162.97.75]) by postgresql.org (Postfix) with ESMTP id ACE759DC807 for ; Thu, 15 Dec 2005 12:03:01 -0400 (AST) Received: from mainbox.archonet.com (84-51-143-99.archon037.adsl.metronet.co.uk [84.51.143.99]) by smtp.metronet.co.uk (MetroNet Mail) with ESMTP id 83D1941E9F0; Thu, 15 Dec 2005 16:02:49 +0000 (GMT) Received: from [192.168.1.17] (client17.office.archonet.com [192.168.1.17]) by mainbox.archonet.com (Postfix) with ESMTP id A618915EA4; Thu, 15 Dec 2005 16:03:00 +0000 (GMT) Message-ID: <43A193B4.5070206@archonet.com> Date: Thu, 15 Dec 2005 16:03:00 +0000 From: Richard Huxton User-Agent: Thunderbird 1.5 (X11/20051025) MIME-Version: 1.0 To: grupos Cc: pgsql-sql@postgresql.org Subject: Re: RETURN SET OF DATA WITH CURSOR References: <43A18B25.1010705@carvalhaes.net> In-Reply-To: <43A18B25.1010705@carvalhaes.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0 required=5 tests=[none] X-Spam-Score: 0 X-Spam-Level: X-Archive-Number: 200512/131 X-Sequence-Number: 23673 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(); -- Richard Huxton Archonet Ltd