Обсуждение: +infinity for dates and timestamps

Поиск
Список
Период
Сортировка

+infinity for dates and timestamps

От
Vik Fearing
Дата:
It has always annoyed me that we can't write '+infinity' for dates and 
timestamps and get the OCD satisfaction of making our queries line up 
with '-infinity'.

I wrote a fix for that some time ago but apparently never posted it.  I 
was reminded of it by jian he in the Infinite Interval thread, and so 
here it is.
-- 
Vik Fearing
Вложения

Re: +infinity for dates and timestamps

От
Vik Fearing
Дата:
On 1/1/23 03:10, Vik Fearing wrote:
> It has always annoyed me that we can't write '+infinity' for dates and 
> timestamps and get the OCD satisfaction of making our queries line up 
> with '-infinity'.
> 
> I wrote a fix for that some time ago but apparently never posted it.  I 
> was reminded of it by jian he in the Infinite Interval thread, and so 
> here it is.

Hmm.  Somehow the .out test files were not included.

Fixed with attached.
-- 
Vik Fearing

Вложения

Re: +infinity for dates and timestamps

От
Tom Lane
Дата:
Vik Fearing <vik@postgresfriends.org> writes:
> It has always annoyed me that we can't write '+infinity' for dates and 
> timestamps and get the OCD satisfaction of making our queries line up 
> with '-infinity'.

+1, since it works for numerics it should work for these types too.
(I didn't read the patch though.)

            regards, tom lane



Re: +infinity for dates and timestamps

От
Tom Lane
Дата:
Vik Fearing <vik@postgresfriends.org> writes:
> Hmm.  Somehow the .out test files were not included.
> Fixed with attached.

Somehow you'd managed to duplicate some of the other changes,
so the cfbot still didn't like that :-(

Anyway, pushed with cosmetic changes.  Notably, I left out the
documentation changes after observing that we don't document
"+infinity" separately for the numeric types.  Given the lack of
complaints about that I think it's fine to do the same here.

            regards, tom lane



Re: +infinity for dates and timestamps

От
Vik Fearing
Дата:
On 1/1/23 20:21, Tom Lane wrote:
> Vik Fearing <vik@postgresfriends.org> writes:
>> Hmm.  Somehow the .out test files were not included.
>> Fixed with attached.
> 
> Somehow you'd managed to duplicate some of the other changes,
> so the cfbot still didn't like that :-(
> 
> Anyway, pushed with cosmetic changes.  Notably, I left out the
> documentation changes after observing that we don't document
> "+infinity" separately for the numeric types.  Given the lack of
> complaints about that I think it's fine to do the same here.

Thanks, Tom!  No objections to your changes.
-- 
Vik Fearing