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

From Chapman Flack
Subject Re: 'infinity'::Interval should be added
Date
Msg-id 5C12650A.50802@anastigmatix.net
Whole thread Raw
In response to 'infinity'::Interval should be added  (Simon Riggs <simon@2ndquadrant.com>)
Responses Re: 'infinity'::Interval should be added  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On 12/13/18 04:41, Simon Riggs wrote:
> SELECT 'infinity'::timestamp;
> works
> 
> SELECT 'infinity'::interval;
> ERROR:  invalid input syntax for type interval: "infinity"

... and if that is made to work, perhaps then arithmetic should be
updated as well, with this producing an infinite interval result:

SELECT timestamptz 'infinity' - current_timestamp;
ERROR:  cannot subtract infinite timestamps

ISO (2011 draft) seems to have nothing to say about infinity, for
datetimes or intervals.

-Chap


pgsql-hackers by date:

Previous
From: David Steele
Date:
Subject: Re: alternative to PG_CATCH
Next
From: Peter Eisentraut
Date:
Subject: Re: Reorganize collation lookup time and place