Possible 7.1RC1 bug

Поиск
Список
Период
Сортировка
От Kyle
Тема Possible 7.1RC1 bug
Дата
Msg-id 3AC394C6.E7D2E184@actarg.com
обсуждение исходный текст
Ответы Re: Possible 7.1RC1 bug  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-sql
Here's a fragment of code that works on 7.0.3 but gives a type mismatch on 7.1:

Under 7.1RC1, func1 fails and func2 builds OK.  The error is:

ERROR:  return type mismatch in function: declared to return int4, returns numeric

It appears that sum(int4) returns type numeric.  Shouldn't it return int4?
 

create table ints (
    inte        int4
);

create function func1() returns int4 as '
    select coalesce(sum(inte),0) from ints;
' language 'sql';

create function func2() returns int4 as '
    select coalesce(sum(inte)::int4,0) from ints;
' language 'sql';
 
 

Вложения

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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: Calling Java from psql (was Re: requesting help)
Следующее
От: Cedar Cox
Дата:
Сообщение: Re: Escaping \