Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id D1BD56339C7 for ; Thu, 22 Oct 2009 10:30:16 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 54674-04 for ; Thu, 22 Oct 2009 13:29:57 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from cirrus.hsolutions.ch (cirrus.hsolutions.ch [212.203.66.103]) by mail.postgresql.org (Postfix) with ESMTP id C8363633919 for ; Thu, 22 Oct 2009 10:30:04 -0300 (ADT) Received: from [192.168.32.120] (unknown [78.234.64.238]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by cirrus.hsolutions.ch (Postfix) with ESMTPSA id 3AB7D880003; Thu, 22 Oct 2009 15:34:55 +0200 (CEST) Message-ID: <4AE05E55.4000500@hsolutions.ch> Date: Thu, 22 Oct 2009 15:29:57 +0200 From: Denis BUCHER Organization: Horus Digital Solutions =?ISO-8859-1?Q?S=E0rl?= User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Richard Huxton 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> In-Reply-To: <4AE05DD0.7010809@archonet.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.516 tagged_above=-10 required=5 tests=AWL=0.083, BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 200910/99 X-Sequence-Number: 33298 Hello Richard, Richard Huxton a écrit : >>>> ERREUR: wrong record type supplied in RETURN NEXT >>>> CONTEXTE : PL/pgSQL function "hds_bw_find_sn_live" line 26 at return next >>>> >>>> Does someone maybe knows what it could be ? >>>> >>>> This is (a part of) my function : >>>> >>>>> CREATE OR REPLACE FUNCTION rma.find_sn_live (varchar(30)) RETURNS SETOF rma.serial_number >>> This is a different function. Function "hds_bw_find_sn_live" has the >>> wrong type for its "return next". >> Hello, >> >> Thanks a lot for your reply : the difference in name is just a mistake >> in my email but in fact it is the same function, I just renamed it wrong >> when doing the "cleaning" before posting my email... > > In that case - have you changed the definition of table > rma.serial_number since you defined the function? No, I just do the test just after the "CREATE OR REPLACE FUNCTION". I saw somwhere it could be the order of the fields ? Denis