Received: from maia.hub.org (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 63035632DBC for ; Wed, 3 Mar 2010 00:07:21 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 99790-09 for ; Wed, 3 Mar 2010 04:07:10 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from calpacs.org (calpacs.org [69.174.246.238]) by mail.postgresql.org (Postfix) with ESMTP id BF31A632D33 for ; Wed, 3 Mar 2010 00:07:10 -0400 (AST) Received: from new.calpacs.org (localhost.localdomain [127.0.0.1]) by calpacs.org (8.13.8/8.13.8) with ESMTP id o23478Me026659 for ; Tue, 2 Mar 2010 22:07:09 -0600 Received: from [192.168.1.4] (pool-173-55-140-58.lsanca.fios.verizon.net [173.55.140.58]) by calpacs.org (Scalix SMTP Relay 11.4.6.13676) via ESMTP; Tue, 02 Mar 2010 22:07:08 -0600 (CST) Date: Tue, 2 Mar 2010 20:07:07 -0800 From: Noel Proffitt To: pgsql-testers@postgresql.org Message-ID: <1267589227.25740.25.camel@keg> Subject: Numerics of diffrent scales Raises Type Mismatch Error in a Set Returning Function x-scalix-Hops: 1 X-Mailer: Evolution 2.28.2 (2.28.2-1.fc12) Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.11 tagged_above=-10 required=5 tests=BAYES_05=-1.11 X-Spam-Level: X-Archive-Number: 201003/1 X-Sequence-Number: 50 [TEST REPORT] [Release]: 9.0 Alpha 4 [Test Type]: feature [Test]: NUMERICS OF DIFFERENT SCALE UNABLE TO CAST TO RESULTS IN SET RETURNING FUNCTION [Platform]: Linux RHEL/Fedora [Parameters]: [Failure]: Yes [Results]: ERROR: wrong record type supplied in RETURN NEXT DETAIL: Returned type numeric does not match expected type numeric(14,2) in column 1. CONTEXT: PL/pgSQL function "check_numeric" line 5 at RETURN NEXT -- Test case CREATE TABLE a_table ( val NUMERIC ); INSERT INTO a_table VALUES (42); CREATE TABLE b_table ( val NUMERIC(14,2) ); CREATE OR REPLACE FUNCTION check_numeric() RETURNS SETOF b_table AS $$ DECLARE myrec RECORD; BEGIN SELECT * INTO myrec FROM a_table; RETURN NEXT myrec; RETURN; END; $$ LANGUAGE 'plpgsql' IMMUTABLE; SELECT * FROM check_numeric(); [Comments]: Works in Pg 8.3 and 8.4. Didn't see a change in the release notes notifying of the behavior change.