Re: 'infinity'::Interval should be added - Mailing list pgsql-hackers

From Tom Lane
Subject Re: 'infinity'::Interval should be added
Date
Msg-id 25913.1544821903@sss.pgh.pa.us
Whole thread Raw
In response to Re: 'infinity'::Interval should be added  (Isaac Morland <isaac.morland@gmail.com>)
Responses Re: 'infinity'::Interval should be added
List pgsql-hackers
Isaac Morland <isaac.morland@gmail.com> writes:
> I would be interested if you have an example where the ability of
> date/timestamp values to be infinite adds special case coding.

I think Robert is talking about the implementation functions for
timestamp-related operations, which typically do have to special-case
infinite inputs.  I take your point that there might be fewer special
cases in the calling SQL code, though.

> The wart I'm worried about is subtraction of infinite dates. Right now
> dates subtract to give integers; and there are no infinite integers. All
> the clever solutions to this I have right now involve making highly
> backward-incompatible changes.

As far as that goes, I'm content to say that infinity is outside the
domain of type date.  If you need infinities, use timestamp.

            regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: ExecBuildGroupingEqual versus collations
Next
From: John Naylor
Date:
Subject: Re: inconsistency and inefficiency in setup_conversion()