Re: 'real' strange problem in 7.1.3

Поиск
Список
Период
Сортировка
От G. Anthony Reina
Тема Re: 'real' strange problem in 7.1.3
Дата
Msg-id 3BEC570C.582FEBB@nsi.edu
обсуждение исходный текст
Ответ на 'real' strange problem in 7.1.3  (reina@nsi.edu (Tony Reina))
Ответы Re: 'real' strange problem in 7.1.3  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Tom Lane wrote:

> You *might* find that writing "where ellipse_ratio = 1.8::float4"
> selects your database row, or you might not --- if the 1.8 in the
> database was the result of a calculation, and didn't arise directly
> from input conversion of the exact string "1.8", then the odds are
> it won't match.  (Your example with putting single quotes around the
> 1.8 is equivalent to this explicit coercion, BTW.)
>
>

Ah, floating point precision errors! Yes, this makes sense now. Plus,
you're saying that putting the 1.8 in quotes is interpreted by the parser
as adding the ::float4 at the end. That's the bit of information that I
needed. I thought that perhaps my value was being stored as a string even
though PG was telling me that it was a float.

Thanks Tom and Stephan.

-Tony




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

Предыдущее
От: Lamar Owen
Дата:
Сообщение: Re: Error on stock postgresql-tcl-7.1.3-2.i386.rpm included in RH7.2
Следующее
От: teg@redhat.com (Trond Eivind Glomsrød)
Дата:
Сообщение: Re: Error on stock postgresql-tcl-7.1.3-2.i386.rpm included in RH7.2