pg.ddx.io  pgsql-testers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Noel Proffitt <noelp@calpacs.org>
To: pgsql-testers@postgresql.org
Subject: Numerics of diffrent scales Raises Type Mismatch Error in a Set Returning Function
Date: Tue, 2 Mar 2010 20:07:07 -0800
Message-ID: <1267589227.25740.25.camel@keg> (raw)

[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.





view thread (5+ messages)  latest in thread

Message-ID: <1267589227.25740.25.camel@keg>
Permalink:  ../1267589227.25740.25.camel@keg/
Also on:    postgresql.org/message-id/1267589227.25740.25.camel@keg

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-testers@postgresql.org
  Cc: noelp@calpacs.org
  Subject: Re: Numerics of diffrent scales Raises Type Mismatch Error in a Set Returning Function
  In-Reply-To: <1267589227.25740.25.camel@keg>
  References: <1267589227.25740.25.camel@keg>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox