+infinity for dates and timestamps

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

+infinity for dates and timestamps

От:
Vik Fearing <vik@postgresfriends.org>
Дата:
Вложения:
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 <vik@postgresfriends.org>
Дата:
Вложения:
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 <tgl@sss.pgh.pa.us>
Дата:
Vik Fearing  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 <tgl@sss.pgh.pa.us>
Дата:
Vik Fearing  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 <vik@postgresfriends.org>
Дата:
On 1/1/23 20:21, Tom Lane wrote:
> Vik Fearing  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



FAQ