Skip to content

Commit c53ab8a

Browse files
committed
Remove just-added tests for to_timestamp(float8) with out-of-range inputs.
Reporting the specific out-of-range input value produces platform-dependent results. We could skip reporting the value, but that's contrary to our message style guidelines and unhelpful to users. Or we could add a separate expected-output file for Windows, but that would be a substantial maintenance burden, and these test cases seem unlikely to be worth it. Per buildfarm.
1 parent c3834ef commit c53ab8a

File tree

2 files changed

+2
-11
lines changed

2 files changed

+2
-11
lines changed

src/test/regress/expected/timestamptz.out

+1-7
Original file line numberDiff line numberDiff line change
@@ -2326,19 +2326,13 @@ SELECT to_timestamp(1262349296.7890123); -- 2010-01-01 12:34:56.789012+00
23262326
(1 row)
23272327

23282328
-- edge cases
2329-
SELECT to_timestamp(-1e20::float8); -- error, out of range
2330-
ERROR: timestamp out of range: "-1e+20"
2331-
SELECT to_timestamp(-210866803200.0625); -- error, out of range
2332-
ERROR: timestamp out of range: "-2.10867e+11"
23332329
SELECT to_timestamp(-210866803200); -- 4714-11-24 00:00:00+00 BC
23342330
to_timestamp
23352331
---------------------------------
23362332
Mon Nov 24 00:00:00 4714 UTC BC
23372333
(1 row)
23382334

2339-
-- The upper boundary differs between integer and float timestamps, so check the biggest one
2340-
SELECT to_timestamp(185331707078400::float8); -- error, out of range
2341-
ERROR: timestamp out of range: "1.85332e+14"
2335+
-- upper limit varies between integer and float timestamps, so hard to test
23422336
-- nonfinite values
23432337
SELECT to_timestamp(' Infinity'::float);
23442338
to_timestamp

src/test/regress/sql/timestamptz.sql

+1-4
Original file line numberDiff line numberDiff line change
@@ -407,11 +407,8 @@ SELECT to_timestamp( 0); -- 1970-01-01 00:00:00+00
407407
SELECT to_timestamp( 946684800); -- 2000-01-01 00:00:00+00
408408
SELECT to_timestamp(1262349296.7890123); -- 2010-01-01 12:34:56.789012+00
409409
-- edge cases
410-
SELECT to_timestamp(-1e20::float8); -- error, out of range
411-
SELECT to_timestamp(-210866803200.0625); -- error, out of range
412410
SELECT to_timestamp(-210866803200); -- 4714-11-24 00:00:00+00 BC
413-
-- The upper boundary differs between integer and float timestamps, so check the biggest one
414-
SELECT to_timestamp(185331707078400::float8); -- error, out of range
411+
-- upper limit varies between integer and float timestamps, so hard to test
415412
-- nonfinite values
416413
SELECT to_timestamp(' Infinity'::float);
417414
SELECT to_timestamp('-Infinity'::float);

0 commit comments

Comments
 (0)