Re: 'real' strange problem in 7.1.3 - Mailing list pgsql-hackers

From G. Anthony Reina
Subject Re: 'real' strange problem in 7.1.3
Date
Msg-id 3BEC570C.582FEBB@nsi.edu
Whole thread Raw
In response to 'real' strange problem in 7.1.3  (reina@nsi.edu (Tony Reina))
Responses Re: 'real' strange problem in 7.1.3
List 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 by date:

Previous
From: Lamar Owen
Date:
Subject: Re: Error on stock postgresql-tcl-7.1.3-2.i386.rpm included in RH7.2
Next
From: teg@redhat.com (Trond Eivind Glomsrød)
Date:
Subject: Re: Error on stock postgresql-tcl-7.1.3-2.i386.rpm included in RH7.2