On Wed, Mar 30, 2016 at 6:09 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Allow to_timestamp(float8) to convert float infinity to timestamp infinity.
>
> With the original SQL-function implementation, such cases failed because
> we don't support infinite intervals. Converting the function to C lets
> us bypass the interval representation, which should be a bit faster as
> well as more flexible.
+-- The upper boundary differs between integer and float timestamps,
so check the biggest one
+SELECT to_timestamp(185331707078400::float8); -- error, out of range
+ERROR: timestamp out of range: "1.85332e+14"
Some of the tests introduced are making MSVC unhappy, because they
depend on the three-digit behavior that Windows is using, leading to
those failures:
-- The upper boundary differs between integer and float timestamps,
so check the biggest one SELECT to_timestamp(185331707078400::float8); -- error, out of range
! ERROR: timestamp out of range: "1.85332e+14" -- nonfinite values SELECT to_timestamp(' Infinity'::float);
to_timestamp
--- 2338,2344 ----
-- The upper boundary differs between integer and float timestamps,
so check the biggest one SELECT to_timestamp(185331707078400::float8); -- error, out of range
! ERROR: timestamp out of range: "1.85332e+014"
If the those tests are kept, an alternate output file is necessary (I
can send a patch if needed, I see the failure locally as well).
--
Michael