Re: Equality search on timestamp value returns no rows - Mailing list pgsql-general

From Tomasz Ostrowski
Subject Re: Equality search on timestamp value returns no rows
Date
Msg-id 48886BD3.1010206@batory.org.pl
Whole thread Raw
In response to Equality search on timestamp value returns no rows  (Keaton Adams <kadams@mxlogic.com>)
List 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

pgsql-general by date:

Previous
From: "M. François Benoît-Marand"
Date:
Subject: Re: C function working with input/ouput tables failed !
Next
From: John DeSoi
Date:
Subject: Re: mac install question