Numerics of diffrent scales Raises Type Mismatch Error in a Set Returning Function

Поиск
Список
Период
Сортировка
От Noel Proffitt
Тема Numerics of diffrent scales Raises Type Mismatch Error in a Set Returning Function
Дата
Msg-id 1267589227.25740.25.camel@keg
обсуждение исходный текст
Ответы Re: Numerics of diffrent scales Raises Type Mismatch Error in a Set Returning Function  (Josh Berkus <josh@agliodbs.com>)
Список pgsql-testers
[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.



В списке pgsql-testers по дате отправления:

Предыдущее
От: Lou Picciano
Дата:
Сообщение: Re: PostgreSQL 9.0 alpha 4: build issues - modules - with OpenSSL 0.9.8l
Следующее
От: Josh Berkus
Дата:
Сообщение: Re: Numerics of diffrent scales Raises Type Mismatch Error in a Set Returning Function