Commit 4a071afb authored by Tom Lane's avatar Tom Lane

Stabilize timetz test across DST transitions.

The timetz test cases I added in commit a9632830 were unintentionally
sensitive to whether or not DST is active in the PST8PDT time zone.
Thus, they'll start failing this coming weekend, as reported by
Bernhard M. Wiedemann in bug #16689.  Fortunately, DST-awareness is
not significant to the purpose of these test cases, so we can just
force them all to PDT (DST hours) to preserve stability of the
results.

Back-patch to v10, as the prior patch was.

Discussion: https://postgr.es/m/16689-57701daa23b377bf@postgresql.org
parent f90149e6
...@@ -91,45 +91,45 @@ SELECT f1 AS "Ten" FROM TIMETZ_TBL WHERE f1 >= '00:00-07'; ...@@ -91,45 +91,45 @@ SELECT f1 AS "Ten" FROM TIMETZ_TBL WHERE f1 >= '00:00-07';
(12 rows) (12 rows)
-- Check edge cases -- Check edge cases
SELECT '23:59:59.999999'::timetz; SELECT '23:59:59.999999 PDT'::timetz;
timetz timetz
-------------------- --------------------
23:59:59.999999-07 23:59:59.999999-07
(1 row) (1 row)
SELECT '23:59:59.9999999'::timetz; -- rounds up SELECT '23:59:59.9999999 PDT'::timetz; -- rounds up
timetz timetz
------------- -------------
24:00:00-07 24:00:00-07
(1 row) (1 row)
SELECT '23:59:60'::timetz; -- rounds up SELECT '23:59:60 PDT'::timetz; -- rounds up
timetz timetz
------------- -------------
24:00:00-07 24:00:00-07
(1 row) (1 row)
SELECT '24:00:00'::timetz; -- allowed SELECT '24:00:00 PDT'::timetz; -- allowed
timetz timetz
------------- -------------
24:00:00-07 24:00:00-07
(1 row) (1 row)
SELECT '24:00:00.01'::timetz; -- not allowed SELECT '24:00:00.01 PDT'::timetz; -- not allowed
ERROR: date/time field value out of range: "24:00:00.01" ERROR: date/time field value out of range: "24:00:00.01 PDT"
LINE 1: SELECT '24:00:00.01'::timetz; LINE 1: SELECT '24:00:00.01 PDT'::timetz;
^ ^
SELECT '23:59:60.01'::timetz; -- not allowed SELECT '23:59:60.01 PDT'::timetz; -- not allowed
ERROR: date/time field value out of range: "23:59:60.01" ERROR: date/time field value out of range: "23:59:60.01 PDT"
LINE 1: SELECT '23:59:60.01'::timetz; LINE 1: SELECT '23:59:60.01 PDT'::timetz;
^ ^
SELECT '24:01:00'::timetz; -- not allowed SELECT '24:01:00 PDT'::timetz; -- not allowed
ERROR: date/time field value out of range: "24:01:00" ERROR: date/time field value out of range: "24:01:00 PDT"
LINE 1: SELECT '24:01:00'::timetz; LINE 1: SELECT '24:01:00 PDT'::timetz;
^ ^
SELECT '25:00:00'::timetz; -- not allowed SELECT '25:00:00 PDT'::timetz; -- not allowed
ERROR: date/time field value out of range: "25:00:00" ERROR: date/time field value out of range: "25:00:00 PDT"
LINE 1: SELECT '25:00:00'::timetz; LINE 1: SELECT '25:00:00 PDT'::timetz;
^ ^
-- --
-- TIME simple math -- TIME simple math
......
...@@ -36,14 +36,14 @@ SELECT f1 AS "None" FROM TIMETZ_TBL WHERE f1 < '00:00-07'; ...@@ -36,14 +36,14 @@ SELECT f1 AS "None" FROM TIMETZ_TBL WHERE f1 < '00:00-07';
SELECT f1 AS "Ten" FROM TIMETZ_TBL WHERE f1 >= '00:00-07'; SELECT f1 AS "Ten" FROM TIMETZ_TBL WHERE f1 >= '00:00-07';
-- Check edge cases -- Check edge cases
SELECT '23:59:59.999999'::timetz; SELECT '23:59:59.999999 PDT'::timetz;
SELECT '23:59:59.9999999'::timetz; -- rounds up SELECT '23:59:59.9999999 PDT'::timetz; -- rounds up
SELECT '23:59:60'::timetz; -- rounds up SELECT '23:59:60 PDT'::timetz; -- rounds up
SELECT '24:00:00'::timetz; -- allowed SELECT '24:00:00 PDT'::timetz; -- allowed
SELECT '24:00:00.01'::timetz; -- not allowed SELECT '24:00:00.01 PDT'::timetz; -- not allowed
SELECT '23:59:60.01'::timetz; -- not allowed SELECT '23:59:60.01 PDT'::timetz; -- not allowed
SELECT '24:01:00'::timetz; -- not allowed SELECT '24:01:00 PDT'::timetz; -- not allowed
SELECT '25:00:00'::timetz; -- not allowed SELECT '25:00:00 PDT'::timetz; -- not allowed
-- --
-- TIME simple math -- TIME simple math
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment