Re: Equality search on timestamp value returns no rows

From: Tomasz Ostrowski <tometzky(at)batory(dot)org(dot)pl>
To: Keaton Adams <kadams(at)mxlogic(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Equality search on timestamp value returns no rows
Date: 2008-07-24 11:47:31
Message-ID: 48886BD3.1010206@batory.org.pl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 2008-07-23 21:24, Keaton Adams wrote:

> We run into a problem when an equality search on a timestamp column
> returns no records, even when there are records to return, as in this
> example:
>
> mxl=# select * from mxl_scheduler_queue where status_modified =
> '2008-07-03 16:55:06.44695-06';

Never use equality with floating point number as they are stored inexact.

Use for example:
select * from mxl_scheduler_queue where status_modified>='2008-07-03
16:55:06' and status_modified<'2008-07-03 16:55:07';

You can also compile Postgres with integer timestamps which does not
have this problem. You'll need to backup/initdb/restore though.

Regards
Tometzky
--
...although Eating Honey was a very good thing to do, there was a
moment just before you began to eat it which was better than when you
were...
Winnie the Pooh

In response to

Browse pgsql-general by date

  From Date Subject
Next Message John DeSoi 2008-07-24 11:55:03 Re: mac install question
Previous Message M. François =?iso-8859-1?b?QmVub+50LU1hcmFuZA==?= 2008-07-24 11:35:08 Re: C function working with input/ouput tables failed !