Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id CEE4E633968 for ; Thu, 22 Oct 2009 10:46:19 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 19908-07 for ; Thu, 22 Oct 2009 13:46:11 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from relay.pcl-ipout01.plus.net (relay.pcl-ipout01.plus.net [212.159.7.99]) by mail.postgresql.org (Postfix) with ESMTP id 9FC4B6335AE for ; Thu, 22 Oct 2009 10:46:11 -0300 (ADT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAPb+30pUXebi/2dsb2JhbADbRIQ/BA Received: from relay03.plus.net ([84.93.230.226]) by relay.pcl-ipout01.plus.net with ESMTP; 22 Oct 2009 14:46:09 +0100 Received: from [84.51.143.99] (helo=server3.office.archonet.com) by relay03.plus.net with esmtp (Exim) id 1N0xzV-00008b-In; Thu, 22 Oct 2009 14:46:09 +0100 Received: from [192.168.1.36] (dell36.office.archonet.com [192.168.1.36]) by server3.office.archonet.com (Postfix) with ESMTPA id 58CE7410008; Thu, 22 Oct 2009 14:46:09 +0100 (BST) Message-ID: <4AE06221.5040403@archonet.com> Date: Thu, 22 Oct 2009 14:46:09 +0100 From: Richard Huxton User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Denis BUCHER CC: pgsql-sql@postgresql.org Subject: Re: Problem with return type of function ??? References: <4AE042AF.9020507@hsolutions.ch> <4AE044C6.8010306@archonet.com> <4AE046B7.5070805@hsolutions.ch> <4AE05DD0.7010809@archonet.com> <4AE05E55.4000500@hsolutions.ch> In-Reply-To: <4AE05E55.4000500@hsolutions.ch> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Plusnet-Relay: c9e81df5001ce570ba6e34907137b6ea X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-3.599 tagged_above=-10 required=5 tests=BAYES_00=-2.599, RCVD_IN_DNSWL_LOW=-1 X-Spam-Level: X-Archive-Number: 200910/100 X-Sequence-Number: 33299 Denis BUCHER wrote: > I saw somwhere it could be the order of the fields ? Not if you are doing "SELECT * FROM". Create an empty test database and a short script to create the table and function, insert a couple of rows then call the function. If you wrap the whole thing in BEGIN ... ROLLBACK we can change things until we see the problem. The other thing you could try is printing out row before returning it: RAISE NOTICE 'row = %', row; RETURN NEXT ROW; It might be you've not got what you were expecting. -- Richard Huxton Archonet Ltd