···1-From 4a071afbd056282746a5bc9362e87f579a56402d Mon Sep 17 00:00:00 2001
2-From: Tom Lane <tgl@sss.pgh.pa.us>
3-Date: Thu, 29 Oct 2020 15:28:14 -0400
4-Subject: [PATCH 1/1] Stabilize timetz test across DST transitions.
5-6-The timetz test cases I added in commit a9632830b were unintentionally
7-sensitive to whether or not DST is active in the PST8PDT time zone.
8-Thus, they'll start failing this coming weekend, as reported by
9-Bernhard M. Wiedemann in bug #16689. Fortunately, DST-awareness is
10-not significant to the purpose of these test cases, so we can just
11-force them all to PDT (DST hours) to preserve stability of the
12-results.
13-14-Back-patch to v10, as the prior patch was.
15-16-Discussion: https://postgr.es/m/16689-57701daa23b377bf@postgresql.org
17-Git viewer: https://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=4a071afbd056282746a5bc9362e87f579a56402d;hp=f90149e6285aaae6b48559afce1bd638ee26c33e
18----
19- src/test/regress/expected/timetz.out | 32 ++++++++++++++--------------
20- src/test/regress/sql/timetz.sql | 16 +++++++-------
21- 2 files changed, 24 insertions(+), 24 deletions(-)
22-23-diff --git a/src/test/regress/expected/timetz.out b/src/test/regress/expected/timetz.out
24-index 038bb5fa09..1ab5ed5105 100644
25---- a/src/test/regress/expected/timetz.out
26-+++ b/src/test/regress/expected/timetz.out
27-@@ -91,45 +91,45 @@ SELECT f1 AS "Ten" FROM TIMETZ_TBL WHERE f1 >= '00:00-07';
28- (12 rows)
29-30- -- Check edge cases
31--SELECT '23:59:59.999999'::timetz;
32-+SELECT '23:59:59.999999 PDT'::timetz;
33- timetz
34- --------------------
35- 23:59:59.999999-07
36- (1 row)
37-38--SELECT '23:59:59.9999999'::timetz; -- rounds up
39-+SELECT '23:59:59.9999999 PDT'::timetz; -- rounds up
40- timetz
41- -------------
42- 24:00:00-07
43- (1 row)
44-45--SELECT '23:59:60'::timetz; -- rounds up
46-+SELECT '23:59:60 PDT'::timetz; -- rounds up
47- timetz
48- -------------
49- 24:00:00-07
50- (1 row)
51-52--SELECT '24:00:00'::timetz; -- allowed
53-+SELECT '24:00:00 PDT'::timetz; -- allowed
54- timetz
55- -------------
56- 24:00:00-07
57- (1 row)
58-59--SELECT '24:00:00.01'::timetz; -- not allowed
60--ERROR: date/time field value out of range: "24:00:00.01"
61--LINE 1: SELECT '24:00:00.01'::timetz;
62-+SELECT '24:00:00.01 PDT'::timetz; -- not allowed
63-+ERROR: date/time field value out of range: "24:00:00.01 PDT"
64-+LINE 1: SELECT '24:00:00.01 PDT'::timetz;
65- ^
66--SELECT '23:59:60.01'::timetz; -- not allowed
67--ERROR: date/time field value out of range: "23:59:60.01"
68--LINE 1: SELECT '23:59:60.01'::timetz;
69-+SELECT '23:59:60.01 PDT'::timetz; -- not allowed
70-+ERROR: date/time field value out of range: "23:59:60.01 PDT"
71-+LINE 1: SELECT '23:59:60.01 PDT'::timetz;
72- ^
73--SELECT '24:01:00'::timetz; -- not allowed
74--ERROR: date/time field value out of range: "24:01:00"
75--LINE 1: SELECT '24:01:00'::timetz;
76-+SELECT '24:01:00 PDT'::timetz; -- not allowed
77-+ERROR: date/time field value out of range: "24:01:00 PDT"
78-+LINE 1: SELECT '24:01:00 PDT'::timetz;
79- ^
80--SELECT '25:00:00'::timetz; -- not allowed
81--ERROR: date/time field value out of range: "25:00:00"
82--LINE 1: SELECT '25:00:00'::timetz;
83-+SELECT '25:00:00 PDT'::timetz; -- not allowed
84-+ERROR: date/time field value out of range: "25:00:00 PDT"
85-+LINE 1: SELECT '25:00:00 PDT'::timetz;
86- ^
87- --
88- -- TIME simple math
89-diff --git a/src/test/regress/sql/timetz.sql b/src/test/regress/sql/timetz.sql
90-index b699e4b03c..ce763d89e8 100644
91---- a/src/test/regress/sql/timetz.sql
92-+++ b/src/test/regress/sql/timetz.sql
93-@@ -36,14 +36,14 @@ SELECT f1 AS "None" FROM TIMETZ_TBL WHERE f1 < '00:00-07';
94- SELECT f1 AS "Ten" FROM TIMETZ_TBL WHERE f1 >= '00:00-07';
95-96- -- Check edge cases
97--SELECT '23:59:59.999999'::timetz;
98--SELECT '23:59:59.9999999'::timetz; -- rounds up
99--SELECT '23:59:60'::timetz; -- rounds up
100--SELECT '24:00:00'::timetz; -- allowed
101--SELECT '24:00:00.01'::timetz; -- not allowed
102--SELECT '23:59:60.01'::timetz; -- not allowed
103--SELECT '24:01:00'::timetz; -- not allowed
104--SELECT '25:00:00'::timetz; -- not allowed
105-+SELECT '23:59:59.999999 PDT'::timetz;
106-+SELECT '23:59:59.9999999 PDT'::timetz; -- rounds up
107-+SELECT '23:59:60 PDT'::timetz; -- rounds up
108-+SELECT '24:00:00 PDT'::timetz; -- allowed
109-+SELECT '24:00:00.01 PDT'::timetz; -- not allowed
110-+SELECT '23:59:60.01 PDT'::timetz; -- not allowed
111-+SELECT '24:01:00 PDT'::timetz; -- not allowed
112-+SELECT '25:00:00 PDT'::timetz; -- not allowed
113-114- --
115- -- TIME simple math
116---
117-2.20.1