Re: unexpected check constraint violation

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: unexpected check constraint violation
Дата
Msg-id 4597.1237849670@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: unexpected check constraint violation  (Scott Marlowe <scott.marlowe@gmail.com>)
Список pgsql-general
Scott Marlowe <scott.marlowe@gmail.com> writes:
> You can either cast the check constraint, or change the field type to
> match double precision.

The short answer here is that 0.00603::double precision and
0.00603::real are unlikely to be exactly the same value, and
which one is greater is a matter of which direction the real
got rounded off in.  On my machine the former is a bit larger:

regression=# select 0.00603::double precision - 0.00603::real;
       ?column?
----------------------
 1.85072421797494e-10
(1 row)

but on another platform it could be the other way around.

            regards, tom lane

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

Предыдущее
От: Ivan Sergio Borgonovo
Дата:
Сообщение: Re: text column constraint, newbie question
Следующее
От: Tom Lane
Дата:
Сообщение: Re: libpq -- reading a timestamp with time zone using binary format