Re: Select "todays" timestamps in an index friendly way

From: Hellmuth Vargas <hivs77(at)gmail(dot)com>
To: spam_eater(at)gmx(dot)net
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Select "todays" timestamps in an index friendly way
Date: 2018-10-23 13:05:44
Message-ID: CAN3Qy4q7uGC8-EUOvD5fdXUdVHMwP2j6mauW1g+RbGSuBT6BgQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi

El mar., 23 de oct. de 2018 a la(s) 05:41, Thomas Kellerer (
spam_eater(at)gmx(dot)net) escribió:

> Lutz Horn schrieb am 23.10.2018 um 12:19:
> > Hi Thomas,
> >
> > On Tue, Oct 23, 2018 at 12:11:55PM +0200, Thomas Kellerer wrote:
> >> I typically use:
> >>
> >> where ts >= date '2018-10-23'
> >> and ts < date '2018-10-23' + 1
> >
> > But here the date is an explicit value. Francisco reworded my question:
> >
> >> if your definition of today is 'same value as now() when truncated to
> >> days'
> >
> > That's what I am (was, thanks to Francisco) looking for.
>
> Then use current_date:
>
> where ts >= current_date
> and ts < current_date + 1
>
>
>
this is equally valid?

where ts >= current_date

cordialmente:

Hellmuth Vargas

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jeff Janes 2018-10-23 13:06:06 Re: Replication question
Previous Message Thomas Kellerer 2018-10-23 10:41:01 Re: Select "todays" timestamps in an index friendly way