Re: Select "todays" timestamps in an index friendly way - Mailing list pgsql-general

From Francisco Olarte
Subject Re: Select "todays" timestamps in an index friendly way
Date
Msg-id CA+bJJbziH8xXSg+4KsSpiWCyX3ORCvcrxKk_d5SRc95AGWZa8A@mail.gmail.com
Whole thread Raw
In response to Re: Select "todays" timestamps in an index friendly way  (Hellmuth Vargas <hivs77@gmail.com>)
Responses Re: Select "todays" timestamps in an index friendly way
List pgsql-general
On Tue, Oct 23, 2018 at 3:05 PM, Hellmuth Vargas <hivs77@gmail.com> wrote:
...
>> Then use current_date:
>>
>>    where ts >= current_date
>>      and ts < current_date + 1
>
> this is equally valid?
>
> where ts >= current_date

It'is not as the problem was stated. Although ts defaulted to now(),
and it is probably defaulted, nothing prohibits him from inserting
timestamps in the future.

Also, I'll point the table used in the sample ( bigserial+timestamp)
does not seem like a real one and the  "timestamps in today" pattern
is commonly used in calendaring applications, which usually insert
appointments in the future and recover this way to print "todays
schedule".

Francisco Olarte.


pgsql-general by date:

Previous
From: "Daniel Fink (PDF)"
Date:
Subject: Enabling bdr in multiple databases on the same postgresql instance/cluster
Next
From: "Lutz Horn"
Date:
Subject: Re: Select "todays" timestamps in an index friendly way