Re: Fractions of seconds in timestamps

From: Valentin Militaru <valentin(dot)militaru(at)telcor(dot)ro>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Fractions of seconds in timestamps
Date: 2012-04-25 07:26:51
Message-ID: 4F97A73B.3010107@telcor.ro
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

What about using

WHERE f BETWEEN '2012-04-23 00:00:00' AND '2012-04-24 00:00:00'?

On 04/25/2012 09:52 AM, Jasen Betts wrote:
> On 2012-04-24, rihad<rihad(at)mail(dot)ru> wrote:
>> As PostgreSQL stores timestamps with a fractional part, does it mean that
>> WHERE f BETWEEN '2012-04-23 00:00:00' AND '2012-04-23 23:59:59' might miss
>> records with values of f equal to 23:59:59.1234 or so?
> yes, it does. BETWEEN doesn't work well for timestamps.
> you have to do it the long way
>
> f>= '2012-04-23 00:00:00' AND f< '2012-04-24 00:00:00'
>
>
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Willy-Bas Loos 2012-04-25 07:42:31 Re: how robust are custom dumps?
Previous Message Jasen Betts 2012-04-25 06:52:01 Re: Fractions of seconds in timestamps