Skip to content

Commit b28b9b1

Browse files
committed
Run regression tests with timezone America/Los_Angeles.
Historically we've used timezone "PST8PDT", but the recent release 2024b of tzdb changes the definition of that zone in a way that breaks many test cases concerned with dates before 1970. Although we've not yet adopted 2024b into our own tree, this is already problematic for people using --with-system-tzdata if their platform has already adopted 2024b. To work with both older and newer versions of tzdb, switch to using "America/Los_Angeles", accepting the ensuing changes in regression test results. Back-patch to all supported branches. Per report and patch from Wolfgang Walther. Discussion: https://postgr.es/m/0a997455-5aba-4cf2-a354-d26d8bcbfae6@technowledgy.de
1 parent f40d9e9 commit b28b9b1

File tree

8 files changed

+176
-161
lines changed

8 files changed

+176
-161
lines changed

doc/src/sgml/ref/set.sgml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ SELECT setseed(<replaceable>value</replaceable>);
198198

199199
<variablelist>
200200
<varlistentry>
201-
<term><literal>'PST8PDT'</literal></term>
201+
<term><literal>'America/Los_Angeles'</literal></term>
202202
<listitem>
203203
<para>
204204
The time zone for Berkeley, California.
@@ -296,7 +296,7 @@ SET datestyle TO postgres, dmy;
296296
<para>
297297
Set the time zone for Berkeley, California:
298298
<screen>
299-
SET TIME ZONE 'PST8PDT';
299+
SET TIME ZONE 'America/Los_Angeles';
300300
</screen>
301301
</para>
302302

doc/src/sgml/regress.sgml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -530,11 +530,11 @@ make check NO_LOCALE=1
530530
<para>
531531
Most of the date and time results are dependent on the time zone
532532
environment. The reference files are generated for time zone
533-
<literal>PST8PDT</literal> (Berkeley, California), and there will be
533+
<literal>America/Los_Angeles</literal>, and there will be
534534
apparent failures if the tests are not run with that time zone setting.
535535
The regression test driver sets environment variable
536-
<envar>PGTZ</envar> to <literal>PST8PDT</literal>, which normally
537-
ensures proper results.
536+
<envar>PGTZ</envar> to <literal>America/Los_Angeles</literal>,
537+
which normally ensures proper results.
538538
</para>
539539
</sect2>
540540

src/test/regress/expected/date.out

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1148,7 +1148,7 @@ SELECT DATE_TRUNC('MILLENNIUM', TIMESTAMP '1970-03-20 04:30:00.00000'); -- 1001
11481148
SELECT DATE_TRUNC('MILLENNIUM', DATE '1970-03-20'); -- 1001-01-01
11491149
date_trunc
11501150
------------------------------
1151-
Thu Jan 01 00:00:00 1001 PST
1151+
Thu Jan 01 00:00:00 1001 LMT
11521152
(1 row)
11531153

11541154
SELECT DATE_TRUNC('CENTURY', TIMESTAMP '1970-03-20 04:30:00.00000'); -- 1901
@@ -1172,13 +1172,13 @@ SELECT DATE_TRUNC('CENTURY', DATE '2004-08-10'); -- 2001-01-01
11721172
SELECT DATE_TRUNC('CENTURY', DATE '0002-02-04'); -- 0001-01-01
11731173
date_trunc
11741174
------------------------------
1175-
Mon Jan 01 00:00:00 0001 PST
1175+
Mon Jan 01 00:00:00 0001 LMT
11761176
(1 row)
11771177

11781178
SELECT DATE_TRUNC('CENTURY', DATE '0055-08-10 BC'); -- 0100-01-01 BC
11791179
date_trunc
11801180
---------------------------------
1181-
Tue Jan 01 00:00:00 0100 PST BC
1181+
Tue Jan 01 00:00:00 0100 LMT BC
11821182
(1 row)
11831183

11841184
SELECT DATE_TRUNC('DECADE', DATE '1993-12-25'); -- 1990-01-01
@@ -1190,13 +1190,13 @@ SELECT DATE_TRUNC('DECADE', DATE '1993-12-25'); -- 1990-01-01
11901190
SELECT DATE_TRUNC('DECADE', DATE '0004-12-25'); -- 0001-01-01 BC
11911191
date_trunc
11921192
---------------------------------
1193-
Sat Jan 01 00:00:00 0001 PST BC
1193+
Sat Jan 01 00:00:00 0001 LMT BC
11941194
(1 row)
11951195

11961196
SELECT DATE_TRUNC('DECADE', DATE '0002-12-31 BC'); -- 0011-01-01 BC
11971197
date_trunc
11981198
---------------------------------
1199-
Mon Jan 01 00:00:00 0011 PST BC
1199+
Mon Jan 01 00:00:00 0011 LMT BC
12001200
(1 row)
12011201

12021202
--

src/test/regress/expected/horology.out

Lines changed: 31 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
--
22
-- HOROLOGY
33
--
4-
SET DateStyle = 'Postgres, MDY';
5-
SHOW TimeZone; -- Many of these tests depend on the prevailing setting
6-
TimeZone
7-
----------
8-
PST8PDT
4+
SHOW TimeZone; -- Many of these tests depend on the prevailing settings
5+
TimeZone
6+
---------------------
7+
America/Los_Angeles
8+
(1 row)
9+
10+
SHOW DateStyle;
11+
DateStyle
12+
---------------
13+
Postgres, MDY
914
(1 row)
1015

1116
--
@@ -765,12 +770,12 @@ SELECT '' AS "64", d1 + interval '1 year' AS one_year FROM TIMESTAMPTZ_TBL;
765770
| Sat Feb 14 17:32:01 1998 PST
766771
| Sun Feb 15 17:32:01 1998 PST
767772
| Mon Feb 16 17:32:01 1998 PST
768-
| Thu Feb 16 17:32:01 0096 PST BC
769-
| Sun Feb 16 17:32:01 0098 PST
770-
| Fri Feb 16 17:32:01 0598 PST
771-
| Wed Feb 16 17:32:01 1098 PST
772-
| Sun Feb 16 17:32:01 1698 PST
773-
| Fri Feb 16 17:32:01 1798 PST
773+
| Thu Feb 16 17:32:01 0096 LMT BC
774+
| Sun Feb 16 17:32:01 0098 LMT
775+
| Fri Feb 16 17:32:01 0598 LMT
776+
| Wed Feb 16 17:32:01 1098 LMT
777+
| Sun Feb 16 17:32:01 1698 LMT
778+
| Fri Feb 16 17:32:01 1798 LMT
774779
| Wed Feb 16 17:32:01 1898 PST
775780
| Mon Feb 16 17:32:01 1998 PST
776781
| Sun Feb 16 17:32:01 2098 PST
@@ -836,12 +841,12 @@ SELECT '' AS "64", d1 - interval '1 year' AS one_year FROM TIMESTAMPTZ_TBL;
836841
| Wed Feb 14 17:32:01 1996 PST
837842
| Thu Feb 15 17:32:01 1996 PST
838843
| Fri Feb 16 17:32:01 1996 PST
839-
| Mon Feb 16 17:32:01 0098 PST BC
840-
| Thu Feb 16 17:32:01 0096 PST
841-
| Tue Feb 16 17:32:01 0596 PST
842-
| Sun Feb 16 17:32:01 1096 PST
843-
| Thu Feb 16 17:32:01 1696 PST
844-
| Tue Feb 16 17:32:01 1796 PST
844+
| Mon Feb 16 17:32:01 0098 LMT BC
845+
| Thu Feb 16 17:32:01 0096 LMT
846+
| Tue Feb 16 17:32:01 0596 LMT
847+
| Sun Feb 16 17:32:01 1096 LMT
848+
| Thu Feb 16 17:32:01 1696 LMT
849+
| Tue Feb 16 17:32:01 1796 LMT
845850
| Sun Feb 16 17:32:01 1896 PST
846851
| Fri Feb 16 17:32:01 1996 PST
847852
| Thu Feb 16 17:32:01 2096 PST
@@ -2120,7 +2125,7 @@ SELECT '2020-10-05'::timestamptz > '2202020-10-05'::date as f;
21202125
SELECT '4714-11-24 BC'::date::timestamptz;
21212126
timestamptz
21222127
---------------------------------
2123-
Mon Nov 24 00:00:00 4714 PST BC
2128+
Mon Nov 24 00:00:00 4714 LMT BC
21242129
(1 row)
21252130

21262131
SET TimeZone = 'UTC-2';
@@ -2627,13 +2632,13 @@ RESET DateStyle;
26272632
SELECT to_timestamp('0097/Feb/16 --> 08:14:30', 'YYYY/Mon/DD --> HH:MI:SS');
26282633
to_timestamp
26292634
------------------------------
2630-
Sat Feb 16 08:14:30 0097 PST
2635+
Sat Feb 16 08:14:30 0097 LMT
26312636
(1 row)
26322637

26332638
SELECT to_timestamp('97/2/16 8:14:30', 'FMYYYY/FMMM/FMDD FMHH:FMMI:FMSS');
26342639
to_timestamp
26352640
------------------------------
2636-
Sat Feb 16 08:14:30 0097 PST
2641+
Sat Feb 16 08:14:30 0097 LMT
26372642
(1 row)
26382643

26392644
SELECT to_timestamp('2011$03!18 23_38_15', 'YYYY-MM-DD HH24:MI:SS');
@@ -2670,7 +2675,7 @@ SELECT to_timestamp('My birthday-> Year: 1976, Month: May, Day: 16',
26702675
SELECT to_timestamp('1,582nd VIII 21', 'Y,YYYth FMRM DD');
26712676
to_timestamp
26722677
------------------------------
2673-
Sat Aug 21 00:00:00 1582 PST
2678+
Sat Aug 21 00:00:00 1582 LMT
26742679
(1 row)
26752680

26762681
SELECT to_timestamp('15 "text between quote marks" 98 54 45',
@@ -2734,7 +2739,7 @@ SELECT to_timestamp('1997 AD 11 16', 'YYYY BC MM DD');
27342739
SELECT to_timestamp('1997 BC 11 16', 'YYYY BC MM DD');
27352740
to_timestamp
27362741
---------------------------------
2737-
Tue Nov 16 00:00:00 1997 PST BC
2742+
Tue Nov 16 00:00:00 1997 LMT BC
27382743
(1 row)
27392744

27402745
SELECT to_timestamp('1997 A.D. 11 16', 'YYYY B.C. MM DD');
@@ -2746,7 +2751,7 @@ SELECT to_timestamp('1997 A.D. 11 16', 'YYYY B.C. MM DD');
27462751
SELECT to_timestamp('1997 B.C. 11 16', 'YYYY B.C. MM DD');
27472752
to_timestamp
27482753
---------------------------------
2749-
Tue Nov 16 00:00:00 1997 PST BC
2754+
Tue Nov 16 00:00:00 1997 LMT BC
27502755
(1 row)
27512756

27522757
SELECT to_timestamp('9-1116', 'Y-MMDD');
@@ -3016,19 +3021,19 @@ SELECT to_date('-44-02-01 BC','YYYY-MM-DD BC');
30163021
SELECT to_timestamp('44-02-01 11:12:13 BC','YYYY-MM-DD HH24:MI:SS BC');
30173022
to_timestamp
30183023
---------------------------------
3019-
Fri Feb 01 11:12:13 0044 PST BC
3024+
Fri Feb 01 11:12:13 0044 LMT BC
30203025
(1 row)
30213026

30223027
SELECT to_timestamp('-44-02-01 11:12:13','YYYY-MM-DD HH24:MI:SS');
30233028
to_timestamp
30243029
---------------------------------
3025-
Fri Feb 01 11:12:13 0044 PST BC
3030+
Fri Feb 01 11:12:13 0044 LMT BC
30263031
(1 row)
30273032

30283033
SELECT to_timestamp('-44-02-01 11:12:13 BC','YYYY-MM-DD HH24:MI:SS BC');
30293034
to_timestamp
30303035
------------------------------
3031-
Mon Feb 01 11:12:13 0044 PST
3036+
Mon Feb 01 11:12:13 0044 LMT
30323037
(1 row)
30333038

30343039
--

0 commit comments

Comments
 (0)