X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 0893ADAF56 for ; Wed, 26 Oct 2005 16:59:50 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 67164-05 for ; Wed, 26 Oct 2005 19:59:44 +0000 (GMT) Received: from ls405.htnet.hr (ls405.htnet.hr [195.29.150.97]) by svr1.postgresql.org (Postfix) with ESMTP id 6B01DDA95B for ; Wed, 26 Oct 2005 16:59:45 -0300 (ADT) Received: from ls422.t-com.hr (ls422.t-com.hr [195.29.150.237]) by ls405.htnet.hr (0.0.0/8.12.10) with ESMTP id j9QJxiWn004839; Wed, 26 Oct 2005 21:59:46 +0200 Received: from ls422.t-com.hr (localhost.localdomain [127.0.0.1]) by ls422.t-com.hr (Qmlai) with ESMTP id D0C46988043; Wed, 26 Oct 2005 21:59:46 +0200 (CEST) X-Envelope-Sender: mario.splivalo@mobart.hr X-Envelope-Sender: mario.splivalo@mobart.hr Received: from ls422.t-com.hr (localhost.localdomain [127.0.0.1]) by ls422.t-com.hr (Qmlai) with ESMTP id CD66A988042; Wed, 26 Oct 2005 21:59:46 +0200 (CEST) Received: from 83-131-22-222.adsl.net.t-com.hr (83-131-22-222.adsl.net.t-com.hr [83.131.22.222]) by ls422.t-com.hr (Qmlai) with ESMTP id 6EAD28B8069; Wed, 26 Oct 2005 21:59:46 +0200 (CEST) Subject: Re: RETURNS SETOF primitive returns results in parentheses From: Mario Splivalo Reply-To: mario.splivalo@mobart.hr To: Tom Lane Cc: pgsql-sql@postgresql.org In-Reply-To: <10931.1130355933@sss.pgh.pa.us> References: <1130330322.7400.45.camel@ekim> <5954.1130337622@sss.pgh.pa.us> <1130355699.18653.0.camel@localhost.localdomain> <10931.1130355933@sss.pgh.pa.us> Content-Type: text/plain Organization: Mob-Art Date: Wed, 26 Oct 2005 21:57:54 +0200 Message-Id: <1130356674.18653.3.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.2.1.1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 required=5 tests=[none] X-Spam-Level: X-Archive-Number: 200510/346 X-Sequence-Number: 23199 On Wed, 2005-10-26 at 15:45 -0400, Tom Lane wrote: > Mario Splivalo writes: > > Wo-ha, makes perfect sense. So, I'd go by with declaring the rec as > > varchar, instead as of a record. Wich is what I should do in the first > > place. > > Or just return the correct field out of it. > > RETURN NEXT returnValue.fieldname; > > I think you may have to do it this way because the FOR loop wants a > record variable. Yes, you're right. Funny implementation of the FOR loop :) Mike