Skip to content

Commit b27622c

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 9f77494 commit b27622c

File tree

8 files changed

+120
-105
lines changed

8 files changed

+120
-105
lines changed

doc/src/sgml/ref/set.sgml

+2-2
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

+3-3
Original file line numberDiff line numberDiff line change
@@ -556,11 +556,11 @@ make check NO_LOCALE=1
556556
<para>
557557
Most of the date and time results are dependent on the time zone
558558
environment. The reference files are generated for time zone
559-
<literal>PST8PDT</literal> (Berkeley, California), and there will be
559+
<literal>America/Los_Angeles</literal>, and there will be
560560
apparent failures if the tests are not run with that time zone setting.
561561
The regression test driver sets environment variable
562-
<envar>PGTZ</envar> to <literal>PST8PDT</literal>, which normally
563-
ensures proper results.
562+
<envar>PGTZ</envar> to <literal>America/Los_Angeles</literal>,
563+
which normally ensures proper results.
564564
</para>
565565
</sect2>
566566

src/test/regress/expected/date.out

+5-5
Original file line numberDiff line numberDiff line change
@@ -1264,7 +1264,7 @@ SELECT DATE_TRUNC('MILLENNIUM', TIMESTAMP '1970-03-20 04:30:00.00000'); -- 1001
12641264
SELECT DATE_TRUNC('MILLENNIUM', DATE '1970-03-20'); -- 1001-01-01
12651265
date_trunc
12661266
------------------------------
1267-
Thu Jan 01 00:00:00 1001 PST
1267+
Thu Jan 01 00:00:00 1001 LMT
12681268
(1 row)
12691269

12701270
SELECT DATE_TRUNC('CENTURY', TIMESTAMP '1970-03-20 04:30:00.00000'); -- 1901
@@ -1288,13 +1288,13 @@ SELECT DATE_TRUNC('CENTURY', DATE '2004-08-10'); -- 2001-01-01
12881288
SELECT DATE_TRUNC('CENTURY', DATE '0002-02-04'); -- 0001-01-01
12891289
date_trunc
12901290
------------------------------
1291-
Mon Jan 01 00:00:00 0001 PST
1291+
Mon Jan 01 00:00:00 0001 LMT
12921292
(1 row)
12931293

12941294
SELECT DATE_TRUNC('CENTURY', DATE '0055-08-10 BC'); -- 0100-01-01 BC
12951295
date_trunc
12961296
---------------------------------
1297-
Tue Jan 01 00:00:00 0100 PST BC
1297+
Tue Jan 01 00:00:00 0100 LMT BC
12981298
(1 row)
12991299

13001300
SELECT DATE_TRUNC('DECADE', DATE '1993-12-25'); -- 1990-01-01
@@ -1306,13 +1306,13 @@ SELECT DATE_TRUNC('DECADE', DATE '1993-12-25'); -- 1990-01-01
13061306
SELECT DATE_TRUNC('DECADE', DATE '0004-12-25'); -- 0001-01-01 BC
13071307
date_trunc
13081308
---------------------------------
1309-
Sat Jan 01 00:00:00 0001 PST BC
1309+
Sat Jan 01 00:00:00 0001 LMT BC
13101310
(1 row)
13111311

13121312
SELECT DATE_TRUNC('DECADE', DATE '0002-12-31 BC'); -- 0011-01-01 BC
13131313
date_trunc
13141314
---------------------------------
1315-
Mon Jan 01 00:00:00 0011 PST BC
1315+
Mon Jan 01 00:00:00 0011 LMT BC
13161316
(1 row)
13171317

13181318
--

src/test/regress/expected/horology.out

+31-26
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 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 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)