Re: Returning 'Infinity'::TIMESTAMPTZ from "to_timestamp" function - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Returning 'Infinity'::TIMESTAMPTZ from "to_timestamp" function
Date
Msg-id 21367.1447046745@sss.pgh.pa.us
Whole thread Raw
In response to Returning 'Infinity'::TIMESTAMPTZ from "to_timestamp" function  (Vitaly Burovoy <vitaly.burovoy@gmail.com>)
List pgsql-hackers
Vitaly Burovoy <vitaly.burovoy@gmail.com> writes:
> To add an ability to construct 'Infinity' TIMESTAMPTZ via
> "to_timestamp" call, there are two ways:

> 1. Rewrite the function "pg_catalog.to_timestamp(double precision)" as
> an internal one. It's the easiest way, because it allows to avoid
> usage of INTERVAL as a helper (of course, there is still possible to
> use intervals as shown above in user's scripts, but without "Infinity"
> support).

> 2. Add support of infinite intervals. It is harder, because it touches
> a lot of functions. I can add that support if it is in demand.

> Which way is preferred?

I think you should stay away from infinite intervals; that seems like
there would be a lot of definitional questions to be resolved.  Even
if we decide we want to deal with that someday, it shouldn't be a blocking
issue for conversion between infinite floats and infinite timestamps.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Vitaly Burovoy
Date:
Subject: Returning 'Infinity'::TIMESTAMPTZ from "to_timestamp" function
Next
From: Ashutosh Bapat
Date:
Subject: Re: Transactions involving multiple postgres foreign servers