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

From Jim Nasby
Subject Re: Extracting fields from 'infinity'::TIMESTAMP[TZ]
Date
Msg-id 564B46C3.9050006@BlueTreble.com
Whole thread Raw
In response to Re: Extracting fields from 'infinity'::TIMESTAMP[TZ]  (Vitaly Burovoy <vitaly.burovoy@gmail.com>)
Responses Re: Extracting fields from 'infinity'::TIMESTAMP[TZ]  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On 11/17/15 2:09 AM, Vitaly Burovoy wrote:
> I suppose behavior of monotonic values (julian, century, decade,
> isoyear, millennium and year) should be the same as for epoch (which
> obviously also monotonic value).
> 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. It's absolutely NOT the same thing as a NULL 
timestamp. I don't see why the normal constraint of minute < 60 should 
apply here; infinity isn't a normal number.

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.
-- 
Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX
Experts in Analytics, Data Architecture and PostgreSQL
Data in Trouble? Get it in Treble! http://BlueTreble.com



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Bug in numeric multiplication
Next
From: Kevin Grittner
Date:
Subject: Re: Question concerning XTM (eXtensible Transaction Manager API)