Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 809996337C3 for ; Thu, 22 Oct 2009 11:21:54 -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 24889-05 for ; Thu, 22 Oct 2009 14:21:46 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from relay.ptn-ipout02.plus.net (relay.ptn-ipout02.plus.net [212.159.7.36]) by mail.postgresql.org (Postfix) with ESMTP id 248836331B5 for ; Thu, 22 Oct 2009 11:21:44 -0300 (ADT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEADUH4EpUXeby/2dsb2JhbADbXoQ/BA Received: from relay01.plus.net ([84.93.230.242]) by relay.ptn-ipout02.plus.net with ESMTP; 22 Oct 2009 15:21:42 +0100 Received: from [84.51.143.99] (helo=server3.office.archonet.com) by relay01.plus.net with esmtp (Exim) id 1N0yXt-00026Q-Q4; Thu, 22 Oct 2009 15:21:41 +0100 Received: from [192.168.1.36] (dell36.office.archonet.com [192.168.1.36]) by server3.office.archonet.com (Postfix) with ESMTPA id 8E3D6410008; Thu, 22 Oct 2009 15:21:41 +0100 (BST) Message-ID: <4AE06A75.3040803@archonet.com> Date: Thu, 22 Oct 2009 15:21:41 +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> <4AE06221.5040403@archonet.com> <4AE0655C.80400@hsolutions.ch> In-Reply-To: <4AE0655C.80400@hsolutions.ch> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Plusnet-Relay: 5a5d13b9f3b05a85a23693b7f602bce5 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/102 X-Sequence-Number: 33301 Denis BUCHER wrote: > Richard Huxton a =E9crit : >> The other thing you could try is printing out row before returning it: >> RAISE NOTICE 'row =3D %', row; >> RETURN NEXT ROW; >> It might be you've not got what you were expecting. >=20 > Thanks a lot, good idea... >=20 > But it looks good : Hmm... >> SELECT * FROM rma.test ('19G256259'); >> NOTICE: row =3D (12066602,19G256259,170224,PN6405B,2009-09-22,"FORERU= NNER 405 NOIR",2009-09-22,15090,14748) >> ERREUR: wrong record type supplied in RETURN NEXT >> CONTEXTE : PL/pgSQL function "test" line 12 at return next >> >> \d rma.serial_number >> Table =C2=AB rma.serial_number = =C2=BB >> Colonne | Type | Modif= icateurs >> -------------+-----------------------+--------------------------------= ----------------------------------- >> sn_id | bigint | not null default nextval('rma.s= erial_number_sn_id_seq'::regclass) >> sn | character varying(30) | >> no_client | integer | >> no_art_bw | character varying(11) | >> sn_fc_date | date | >> desc_fr | character varying(40) | >> sn_cm_date | date | >> no_facture | integer | >> no_commande | integer | I was wondering if maybe there was a bug to do with domains or complex column types, but there's nothing out of the ordinary here. OK - can you generate a test script with just CREATE TABLE, CREATE FUNCTION, one INSERT and a function-call? I'll try and recreate it here. Oh, and what version of PostgreSQL are we talking about? --=20 Richard Huxton Archonet Ltd