Hello, Hackers! I worked on a patch[1] allows "EXTRACT(epoch FROM +-Inf::timestamp[tz])" to return "+-Inf::float8". There is an opposite function "to_timestamp(float8)" which now defined as: SELECT ('epoch'::timestamptz + $1 * '1 second'::interval)
Since intervals do not support infinity values, it is impossible to do something like: SELECT to_timestamp('infinity'::float8); ... which is not good. Supporting of such converting is in the TODO list[2] (by "converting between infinity timestamp and float8"). Proposed patch implements it. There is an other patch in the CF[3] 2016-03 implements checking of timestamp[tz] for being in allowed range. Since it is wise to set (fix) the upper boundary of timestamp[tz]s, I've included the file "src/include/datatype/timestamp.h" from there to check that an input value and a result are in the allowed range. There is no changes in a documentation because allowed range is the same as officially supported[4] (i.e. until 294277 AD). [1]http://git.postgresql.org/pg/commitdiff/647d87c56ab6da70adb753c08d7cdf7ee905ea8a [2]https://wiki.postgresql.org/wiki/Todo#Dates_and_Times [3]https://commitfest.postgresql.org/9/540/ [4]http://www.postgresql.org/docs/devel/static/datatype-datetime.html -- Best regards, Vitaly Burovoy
to_timestamp_infs.v001.patch
Description: Binary data
-- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers