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

Поиск
Список
Период
Сортировка
От Francisco Olarte
Тема Re: Select "todays" timestamps in an index friendly way
Дата
Msg-id CA+bJJbziH8xXSg+4KsSpiWCyX3ORCvcrxKk_d5SRc95AGWZa8A@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Select "todays" timestamps in an index friendly way  (Hellmuth Vargas <hivs77@gmail.com>)
Ответы Re: Select "todays" timestamps in an index friendly way
Список 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 по дате отправления:

Предыдущее
От: "Daniel Fink (PDF)"
Дата:
Сообщение: Enabling bdr in multiple databases on the same postgresql instance/cluster
Следующее
От: "Lutz Horn"
Дата:
Сообщение: Re: Select "todays" timestamps in an index friendly way