···11-From 4a071afbd056282746a5bc9362e87f579a56402d Mon Sep 17 00:00:00 2001
22-From: Tom Lane <tgl@sss.pgh.pa.us>
33-Date: Thu, 29 Oct 2020 15:28:14 -0400
44-Subject: [PATCH 1/1] Stabilize timetz test across DST transitions.
55-66-The timetz test cases I added in commit a9632830b were unintentionally
77-sensitive to whether or not DST is active in the PST8PDT time zone.
88-Thus, they'll start failing this coming weekend, as reported by
99-Bernhard M. Wiedemann in bug #16689. Fortunately, DST-awareness is
1010-not significant to the purpose of these test cases, so we can just
1111-force them all to PDT (DST hours) to preserve stability of the
1212-results.
1313-1414-Back-patch to v10, as the prior patch was.
1515-1616-Discussion: https://postgr.es/m/16689-57701daa23b377bf@postgresql.org
1717-Git viewer: https://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=4a071afbd056282746a5bc9362e87f579a56402d;hp=f90149e6285aaae6b48559afce1bd638ee26c33e
1818----
1919- src/test/regress/expected/timetz.out | 32 ++++++++++++++--------------
2020- src/test/regress/sql/timetz.sql | 16 +++++++-------
2121- 2 files changed, 24 insertions(+), 24 deletions(-)
2222-2323-diff --git a/src/test/regress/expected/timetz.out b/src/test/regress/expected/timetz.out
2424-index 038bb5fa09..1ab5ed5105 100644
2525---- a/src/test/regress/expected/timetz.out
2626-+++ b/src/test/regress/expected/timetz.out
2727-@@ -91,45 +91,45 @@ SELECT f1 AS "Ten" FROM TIMETZ_TBL WHERE f1 >= '00:00-07';
2828- (12 rows)
2929-3030- -- Check edge cases
3131--SELECT '23:59:59.999999'::timetz;
3232-+SELECT '23:59:59.999999 PDT'::timetz;
3333- timetz
3434- --------------------
3535- 23:59:59.999999-07
3636- (1 row)
3737-3838--SELECT '23:59:59.9999999'::timetz; -- rounds up
3939-+SELECT '23:59:59.9999999 PDT'::timetz; -- rounds up
4040- timetz
4141- -------------
4242- 24:00:00-07
4343- (1 row)
4444-4545--SELECT '23:59:60'::timetz; -- rounds up
4646-+SELECT '23:59:60 PDT'::timetz; -- rounds up
4747- timetz
4848- -------------
4949- 24:00:00-07
5050- (1 row)
5151-5252--SELECT '24:00:00'::timetz; -- allowed
5353-+SELECT '24:00:00 PDT'::timetz; -- allowed
5454- timetz
5555- -------------
5656- 24:00:00-07
5757- (1 row)
5858-5959--SELECT '24:00:00.01'::timetz; -- not allowed
6060--ERROR: date/time field value out of range: "24:00:00.01"
6161--LINE 1: SELECT '24:00:00.01'::timetz;
6262-+SELECT '24:00:00.01 PDT'::timetz; -- not allowed
6363-+ERROR: date/time field value out of range: "24:00:00.01 PDT"
6464-+LINE 1: SELECT '24:00:00.01 PDT'::timetz;
6565- ^
6666--SELECT '23:59:60.01'::timetz; -- not allowed
6767--ERROR: date/time field value out of range: "23:59:60.01"
6868--LINE 1: SELECT '23:59:60.01'::timetz;
6969-+SELECT '23:59:60.01 PDT'::timetz; -- not allowed
7070-+ERROR: date/time field value out of range: "23:59:60.01 PDT"
7171-+LINE 1: SELECT '23:59:60.01 PDT'::timetz;
7272- ^
7373--SELECT '24:01:00'::timetz; -- not allowed
7474--ERROR: date/time field value out of range: "24:01:00"
7575--LINE 1: SELECT '24:01:00'::timetz;
7676-+SELECT '24:01:00 PDT'::timetz; -- not allowed
7777-+ERROR: date/time field value out of range: "24:01:00 PDT"
7878-+LINE 1: SELECT '24:01:00 PDT'::timetz;
7979- ^
8080--SELECT '25:00:00'::timetz; -- not allowed
8181--ERROR: date/time field value out of range: "25:00:00"
8282--LINE 1: SELECT '25:00:00'::timetz;
8383-+SELECT '25:00:00 PDT'::timetz; -- not allowed
8484-+ERROR: date/time field value out of range: "25:00:00 PDT"
8585-+LINE 1: SELECT '25:00:00 PDT'::timetz;
8686- ^
8787- --
8888- -- TIME simple math
8989-diff --git a/src/test/regress/sql/timetz.sql b/src/test/regress/sql/timetz.sql
9090-index b699e4b03c..ce763d89e8 100644
9191---- a/src/test/regress/sql/timetz.sql
9292-+++ b/src/test/regress/sql/timetz.sql
9393-@@ -36,14 +36,14 @@ SELECT f1 AS "None" FROM TIMETZ_TBL WHERE f1 < '00:00-07';
9494- SELECT f1 AS "Ten" FROM TIMETZ_TBL WHERE f1 >= '00:00-07';
9595-9696- -- Check edge cases
9797--SELECT '23:59:59.999999'::timetz;
9898--SELECT '23:59:59.9999999'::timetz; -- rounds up
9999--SELECT '23:59:60'::timetz; -- rounds up
100100--SELECT '24:00:00'::timetz; -- allowed
101101--SELECT '24:00:00.01'::timetz; -- not allowed
102102--SELECT '23:59:60.01'::timetz; -- not allowed
103103--SELECT '24:01:00'::timetz; -- not allowed
104104--SELECT '25:00:00'::timetz; -- not allowed
105105-+SELECT '23:59:59.999999 PDT'::timetz;
106106-+SELECT '23:59:59.9999999 PDT'::timetz; -- rounds up
107107-+SELECT '23:59:60 PDT'::timetz; -- rounds up
108108-+SELECT '24:00:00 PDT'::timetz; -- allowed
109109-+SELECT '24:00:00.01 PDT'::timetz; -- not allowed
110110-+SELECT '23:59:60.01 PDT'::timetz; -- not allowed
111111-+SELECT '24:01:00 PDT'::timetz; -- not allowed
112112-+SELECT '25:00:00 PDT'::timetz; -- not allowed
113113-114114- --
115115- -- TIME simple math
116116---
117117-2.20.1