Re: Problem with datatype REAL using the = (EQUAL) operator

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Problem with datatype REAL using the = (EQUAL) operator
Дата
Msg-id 9417.1076869777@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Problem with datatype REAL using the = (EQUAL) operator  ("Javier Carlos" <javier@evaloportunidades.insp.mx>)
Список pgsql-bugs
"Javier Carlos" <javier@evaloportunidades.insp.mx> writes:
>    When I make a select and in the WHERE section I use the = (EQUAL)
> operator whith a column of real datatype the results of the query is 0
> rows even if there exist rows that match the condition.

This isn't a bug, it's a natural consequence of the limited precision of
the float4 datatype.  The constant "0.11" defaults to type double
precision, and there is no float4 value that exactly equals the double
precision value of 0.11.  Try casting the constant to float4 explicitly,
or putting quotes around it.

            regards, tom lane

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

Предыдущее
От: Harry Hochheiser
Дата:
Сообщение: Default Timestamp 'Now' bug with 7.4 on Panther.
Следующее
От: Bruno Wolff III
Дата:
Сообщение: Re: Problem with datatype REAL using the = (EQUAL) operator