Query precision issue

From: Sairam Krishnamurthy <kmsram420(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Query precision issue
Date: 2010-10-25 17:11:11
Message-ID: 4CC5BA2F.8010202@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

All,

I have simple query like 'select * from table1 where
column1=-107.6898780000'. This returns an empty set. But there is data
corresponding to this value of column.

When I looked more into it, it seems like a precision issue. The value
for column1 is -107.689878.

More interesting is that the following query fetches the row,

'select * from table1 where column1=-107.689878000'

Note that there are only three trailing zeros in the second query while
there were four in the first.

Can somebody help me to find out the problem? I can very well truncate
the trailing zeros when querying, but I am interested in finding why an
additional trailing zero returns an empty set.

--
Thanks,
Sairam Krishnamurthy
+1 612 859 8161

Responses

Browse pgsql-general by date

  From Date Subject
Next Message DM 2010-10-25 17:28:54 Re: Query precision issue
Previous Message Turner, John J 2010-10-25 15:43:05 Re: installing from source in Windows