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

From Chapman Flack
Subject Re: 'infinity'::Interval should be added
Date
Msg-id 7346ffce-2d20-5a56-5940-5a96359fcfd3@anastigmatix.net
Whole thread Raw
In response to Re: 'infinity'::Interval should be added  (Simon Riggs <simon@2ndquadrant.com>)
List pgsql-hackers
On 12/17/18 5:37 PM, Simon Riggs wrote:
> postgres=# select 'infinity'::timestamp = 'infinity'::timestamp;
>  ?column?
> ----------
>  t

I'm not persuaded that's a good idea, and would prefer to see an
is_infinite() predicate, and an = operator that complains. But if
the above is current behavior, I wouldn't say I feel strongly enough
to want to change it.

> postgres=# select 'infinity'::timestamp - 'infinity'::timestamp;
> 
> would be zero rather than an error, for least surprise.

Here, though, I really think an error is appropriate. Getting a
definite finite result from two operands that really mean "I am
huge but otherwise unknown" seems very surprising to me.

-Chap


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Copypasta in the PostgreSQL source
Next
From: Kevin Grittner
Date:
Subject: Re: Referential Integrity Checks with Statement-level Triggers