Re: 'infinity'::Interval should be added

From: Chapman Flack <chap(at)anastigmatix(dot)net>
To: Simon Riggs <simon(at)2ndquadrant(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, Isaac Morland <isaac(dot)morland(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: 'infinity'::Interval should be added
Date: 2018-12-17 22:50:39
Message-ID: 7346ffce-2d20-5a56-5940-5a96359fcfd3@anastigmatix.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Kevin Grittner 2018-12-17 22:51:19 Re: Referential Integrity Checks with Statement-level Triggers
Previous Message Tom Lane 2018-12-17 22:46:29 Re: Copypasta in the PostgreSQL source