Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 394F29FA521 for ; Mon, 28 May 2007 17:07:06 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 35759-01 for ; Mon, 28 May 2007 17:07:03 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from smtp108.mail.mud.yahoo.com (smtp108.mail.mud.yahoo.com [209.191.85.218]) by postgresql.org (Postfix) with SMTP id 7ED309FB272 for ; Mon, 28 May 2007 17:07:02 -0300 (ADT) Received: (qmail 14396 invoked from network); 28 May 2007 20:07:00 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com.br; h=Received:X-YMail-OSG:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject:Content-Type:Content-Transfer-Encoding; b=DbJ9vyhR5rKsQAhfH0H7XFV/ba4KHl24e7wPomiSDZl18fNsU7uSfpnMLodDKwMEtY1YRkwsD7eZj2Pv5Ap2lLbtyHC2U9+OkOUoYOOO87HRPLEgFu+rFm53QRlp4W7jRFq8PelwxKwHe834QYNh3F7coNn7EuQd09DSRlhJxwg= ; Received: from unknown (HELO ?10.90.2.103?) (burbello3000@200.103.143.8 with plain) by smtp108.mail.mud.yahoo.com with SMTP; 28 May 2007 20:07:00 -0000 X-YMail-OSG: cyTpGvoVM1mvonMUEHz9kDh4uGWv4fD62dp.P_lJhDQlYF1.qdCPeTobLrOpLY5KvsSwuIH7.g-- Message-ID: <465B365F.2010605@yahoo.com.br> Date: Mon, 28 May 2007 17:06:55 -0300 From: "Alexander B." User-Agent: Thunderbird 1.5.0.7 (X11/20060911) MIME-Version: 1.0 To: "pgsql-admin@postgresql.org" Subject: Return record on recursive call Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200705/293 X-Sequence-Number: 25613 Hi, I am creating a function that when finished the last level, should return for each row. I put raise notice to trace and the result is correct, but when I try to execute, an error is showed. "ERRO: wrong record type supplied in RETURN NEXT" I created other functions the same way and worked, basically using the same structure but not recursive. Is it different return when using recursive. sample code: "... loop raise notice '' cur1 -> CodCooperativa=% - TipoCoo=%'', cur1.coo_cod_cooperativa, pTipoCoo; cur_result.cod_cooperativa = cur1.coo_cod_cooperativa; cur_result.cooperativa_superior = cur1.coo_cooperativa_superior; cur_result.nro_documento = cur1.coo_nro_documento; cur_result.tipo = cur1.reg_cod_registro; cur_result.nome_fantasia = cur1.coo_nome_fantasia; return next cur_result; ..." Thanks in advance.