Skip site navigation (1) Skip section navigation (2)

Re: Fractions of seconds in timestamps

From: Jasen Betts <jasen(at)xnet(dot)co(dot)nz>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Fractions of seconds in timestamps
Date: 2012-04-25 06:52:01
Message-ID: jn86uh$n42$ (view raw, whole thread or download thread mbox)
Lists: pgsql-general
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'

⚂⚃ 100% natural

In response to


pgsql-general by date

Next:From: Valentin MilitaruDate: 2012-04-25 07:26:51
Subject: Re: Fractions of seconds in timestamps
Previous:From: Toby CorkindaleDate: 2012-04-25 06:18:37
Subject: Bug? Query plans / EXPLAIN using gigabytes of memory

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group