Re: BUG #14046: Bad mathematical rules for 0 cast

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #14046: Bad mathematical rules for 0 cast
Дата
Msg-id 17107.1458913174@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #14046: Bad mathematical rules for 0 cast  (jaroslaw.stoklosa@nomino.pl)
Список pgsql-bugs
jaroslaw.stoklosa@nomino.pl writes:
> +0 and -0 should be casted to +0 or 0.

On what grounds?  The behavior seems sensible to me:

regression=# select cast('-0' as FLOAT);
 float8
--------
     -0
(1 row)

regression=# select cast('-0' as FLOAT)::text;
 text
------
 -0
(1 row)

If we do what you suggest, casting to text would be different from the
type's I/O conversion, which seems strange, and definitely isn't what
most other casts to text do.

            regards, tom lane

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

Предыдущее
От: John McKown
Дата:
Сообщение: Re: BUG #14046: Bad mathematical rules for 0 cast
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: BUG #14045: ** BUILD FAILED **