Re: 'real' strange problem in 7.1.3

From: "G(dot) Anthony Reina" <reina(at)nsi(dot)edu>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: 'real' strange problem in 7.1.3
Date: 2001-11-09 22:22:04
Message-ID: 3BEC570C.582FEBB@nsi.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Trond Eivind =?iso-8859-1?q?Glomsr=F8d?= 2001-11-09 22:27:01 Re: Error on stock postgresql-tcl-7.1.3-2.i386.rpm included in RH7.2
Previous Message Trond Eivind =?iso-8859-1?q?Glomsr=F8d?= 2001-11-09 22:16:03 Re: Error on stock postgresql-tcl-7.1.3-2.i386.rpm included in RH7.2