Re: Fractions of seconds in timestamps - Mailing list pgsql-general

From Jasen Betts
Subject Re: Fractions of seconds in timestamps
Date
Msg-id jn8fuc$oj6$1@reversiblemaps.ath.cx
Whole thread Raw
In response to Fractions of seconds in timestamps  (rihad <rihad@mail.ru>)
Responses Re: Fractions of seconds in timestamps  (Vincenzo Romano <vincenzo.romano@notorand.it>)
List pgsql-general
On 2012-04-25, Valentin Militaru <valentin.militaru@telcor.ro> wrote:
> This is a multi-part message in MIME format.
> --------------050404030901030607030308
> Content-Type: text/plain; charset=UTF-8; format=flowed
> Content-Transfer-Encoding: 7bit
>
> What about using
>
> WHERE f BETWEEN '2012-04-23 00:00:00' AND '2012-04-24 00:00:00'?
>

that could match the first microsecond of 2012-04-24
otherwise not a prolem :)

another option is BETWEEN '2012-04-23 00:00:00' AND '2012-04-23 23:59:60'

or even BETWEEN '2012-04-23 00:00:00' AND '2012-04-23 23:59:60.999999'

these are reliant on documented behaviours, but documented
inosyncratic behaviours, behaviours that could potentially be improved.
such that it woulkd no longer be reliable.

>> you have to do it the long way
>>
>>     f>= '2012-04-23 00:00:00' AND f<  '2012-04-24 00:00:00'
>>

this way is mathematically correct and relies on standard guaranteed
behaviours only.

--
⚂⚃ 100% natural

pgsql-general by date:

Previous
From: Willy-Bas Loos
Date:
Subject: Re: Bug? Query plans / EXPLAIN using gigabytes of memory
Next
From: Toby Corkindale
Date:
Subject: Re: Bug? Query plans / EXPLAIN using gigabytes of memory