Re: Extracting fields from 'infinity'::TIMESTAMP[TZ] - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Extracting fields from 'infinity'::TIMESTAMP[TZ]
Date
Msg-id 32534.1447777453@sss.pgh.pa.us
Whole thread Raw
In response to Re: Extracting fields from 'infinity'::TIMESTAMP[TZ]  (Jim Nasby <Jim.Nasby@BlueTreble.com>)
List pgsql-hackers
Jim Nasby <Jim.Nasby@BlueTreble.com> writes:
> On 11/17/15 2:09 AM, Vitaly Burovoy wrote:
>> Proposed patch has that behavior: ±infinity for epoch, julian,
>> century, decade, isoyear, millennium and year; NULL for other fields.

> What's the logic behind NULL here? Infinity is infinity, whether it's 
> minutes or years.

Didn't you follow the upthread discussion?  Fields such as "minutes"
are cyclic, so it's impossible to say either that they converge to
a defined limit or diverge to infinity as x increases.  NULL, in the
sense of "unknown", seems like a reasonable representation of that.
Infinity doesn't.

> My specific fear is that now people will have to do a bunch of IF 
> timestamp IS NOT NULL THEN ... to get the behavior they need.

Considering that the old behavior is to return zero, and we've had
relatively few complaints about that, I doubt very many people are
going to care.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Extracting fields from 'infinity'::TIMESTAMP[TZ]
Next
From: Oleg Bartunov
Date:
Subject: new full text search configurations