Re: 'infinity'::Interval should be added

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Isaac Morland <isaac(dot)morland(at)gmail(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, simon(at)2ndquadrant(dot)com, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: 'infinity'::Interval should be added
Date: 2018-12-14 21:11:43
Message-ID: 25913.1544821903@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Isaac Morland <isaac(dot)morland(at)gmail(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message John Naylor 2018-12-14 21:28:08 Re: inconsistency and inefficiency in setup_conversion()
Previous Message Tom Lane 2018-12-14 20:59:02 Re: ExecBuildGroupingEqual versus collations