+infinity for dates and timestamps

Started by Vik Fearingover 3 years ago5 messageshackers
Jump to latest
#1Vik 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

Attachments:

plus_infinity.difftext/x-patch; charset=UTF-8; name=plus_infinity.diffDownload+9-2
#2Vik Fearing
vik@postgresfriends.org
In reply to: Vik Fearing (#1)
Re: +infinity for dates and timestamps

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

Attachments:

plus_infinity.v2.difftext/x-patch; charset=UTF-8; name=plus_infinity.v2.diffDownload+37-4
#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Vik Fearing (#1)
Re: +infinity for dates and timestamps

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

#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: Vik Fearing (#2)
Re: +infinity for dates and timestamps

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

#5Vik Fearing
vik@postgresfriends.org
In reply to: Tom Lane (#4)
Re: +infinity for dates and timestamps

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