Re: 'real' strange problem in 7.1.3

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: 'real' strange problem in 7.1.3
Дата
Msg-id 20011109121450.Q58847-100000@megazone23.bigpanda.com
обсуждение исходный текст
Ответ на 'real' strange problem in 7.1.3  (reina@nsi.edu (Tony Reina))
Список pgsql-hackers
>
> Now I try the same command with a different 'real' field:
> db02=# select distinct arm from ellipse where ellipse_ratio = 1.8;
>  arm
> -----
> (0 rows)
>
> BUT, if I put the value in quotes (as if it were a string), I get:
>
> db02=# select distinct arm from ellipse where ellipse_ratio = '1.8';
>  arm
> -----
>  L
>  R
> (2 rows)
>
> which is correct.

The reason is that in the first, the 1.8 is treated as double precision
which is slightly different than the 1.8 as real (you can see this with
a select 1.8::real-1.8;). I think the second postpones deciding the type
and gets converted into a 1.8 as real.




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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: 'real' strange problem in 7.1.3
Следующее
От: Doug McNaught
Дата:
Сообщение: Re: Possible major bug in PlPython (plus some other ideas)