Skip to content

Commit b8ea0f6

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 f64074c commit b8ea0f6

File tree

7 files changed

+111
-101
lines changed

7 files changed

+111
-101
lines changed

doc/src/sgml/ref/set.sgml

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

201201
<variablelist>
202202
<varlistentry>
203-
<term><literal>'PST8PDT'</literal></term>
203+
<term><literal>'America/Los_Angeles'</literal></term>
204204
<listitem>
205205
<para>
206206
The time zone for Berkeley, California.
@@ -298,7 +298,7 @@ SET datestyle TO postgres, dmy;
298298
<para>
299299
Set the time zone for Berkeley, California:
300300
<screen>
301-
SET TIME ZONE 'PST8PDT';
301+
SET TIME ZONE 'America/Los_Angeles';
302302
</screen>
303303
</para>
304304

doc/src/sgml/regress.sgml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -576,11 +576,11 @@ make check NO_LOCALE=1
576576
<para>
577577
Most of the date and time results are dependent on the time zone
578578
environment. The reference files are generated for time zone
579-
<literal>PST8PDT</literal> (Berkeley, California), and there will be
579+
<literal>America/Los_Angeles</literal>, and there will be
580580
apparent failures if the tests are not run with that time zone setting.
581581
The regression test driver sets environment variable
582-
<envar>PGTZ</envar> to <literal>PST8PDT</literal>, which normally
583-
ensures proper results.
582+
<envar>PGTZ</envar> to <literal>America/Los_Angeles</literal>,
583+
which normally ensures proper results.
584584
</para>
585585
</sect2>
586586

src/test/regress/expected/date.out

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1295,7 +1295,7 @@ SELECT DATE_TRUNC('MILLENNIUM', TIMESTAMP '1970-03-20 04:30:00.00000'); -- 1001
12951295
SELECT DATE_TRUNC('MILLENNIUM', DATE '1970-03-20'); -- 1001-01-01
12961296
date_trunc
12971297
------------------------------
1298-
Thu Jan 01 00:00:00 1001 PST
1298+
Thu Jan 01 00:00:00 1001 LMT
12991299
(1 row)
13001300

13011301
SELECT DATE_TRUNC('CENTURY', TIMESTAMP '1970-03-20 04:30:00.00000'); -- 1901
@@ -1319,13 +1319,13 @@ SELECT DATE_TRUNC('CENTURY', DATE '2004-08-10'); -- 2001-01-01
13191319
SELECT DATE_TRUNC('CENTURY', DATE '0002-02-04'); -- 0001-01-01
13201320
date_trunc
13211321
------------------------------
1322-
Mon Jan 01 00:00:00 0001 PST
1322+
Mon Jan 01 00:00:00 0001 LMT
13231323
(1 row)
13241324

13251325
SELECT DATE_TRUNC('CENTURY', DATE '0055-08-10 BC'); -- 0100-01-01 BC
13261326
date_trunc
13271327
---------------------------------
1328-
Tue Jan 01 00:00:00 0100 PST BC
1328+
Tue Jan 01 00:00:00 0100 LMT BC
13291329
(1 row)
13301330

13311331
SELECT DATE_TRUNC('DECADE', DATE '1993-12-25'); -- 1990-01-01
@@ -1337,13 +1337,13 @@ SELECT DATE_TRUNC('DECADE', DATE '1993-12-25'); -- 1990-01-01
13371337
SELECT DATE_TRUNC('DECADE', DATE '0004-12-25'); -- 0001-01-01 BC
13381338
date_trunc
13391339
---------------------------------
1340-
Sat Jan 01 00:00:00 0001 PST BC
1340+
Sat Jan 01 00:00:00 0001 LMT BC
13411341
(1 row)
13421342

13431343
SELECT DATE_TRUNC('DECADE', DATE '0002-12-31 BC'); -- 0011-01-01 BC
13441344
date_trunc
13451345
---------------------------------
1346-
Mon Jan 01 00:00:00 0011 PST BC
1346+
Mon Jan 01 00:00:00 0011 LMT BC
13471347
(1 row)
13481348

13491349
--

src/test/regress/expected/horology.out

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
-- HOROLOGY
33
--
44
SHOW TimeZone; -- Many of these tests depend on the prevailing settings
5-
TimeZone
6-
----------
7-
PST8PDT
5+
TimeZone
6+
---------------------
7+
America/Los_Angeles
88
(1 row)
99

1010
SHOW DateStyle;
@@ -1038,12 +1038,12 @@ SELECT d1 + interval '1 year' AS one_year FROM TIMESTAMPTZ_TBL;
10381038
Sat Feb 14 17:32:01 1998 PST
10391039
Sun Feb 15 17:32:01 1998 PST
10401040
Mon Feb 16 17:32:01 1998 PST
1041-
Thu Feb 16 17:32:01 0096 PST BC
1042-
Sun Feb 16 17:32:01 0098 PST
1043-
Fri Feb 16 17:32:01 0598 PST
1044-
Wed Feb 16 17:32:01 1098 PST
1045-
Sun Feb 16 17:32:01 1698 PST
1046-
Fri Feb 16 17:32:01 1798 PST
1041+
Thu Feb 16 17:32:01 0096 LMT BC
1042+
Sun Feb 16 17:32:01 0098 LMT
1043+
Fri Feb 16 17:32:01 0598 LMT
1044+
Wed Feb 16 17:32:01 1098 LMT
1045+
Sun Feb 16 17:32:01 1698 LMT
1046+
Fri Feb 16 17:32:01 1798 LMT
10471047
Wed Feb 16 17:32:01 1898 PST
10481048
Mon Feb 16 17:32:01 1998 PST
10491049
Sun Feb 16 17:32:01 2098 PST
@@ -1109,12 +1109,12 @@ SELECT d1 - interval '1 year' AS one_year FROM TIMESTAMPTZ_TBL;
11091109
Wed Feb 14 17:32:01 1996 PST
11101110
Thu Feb 15 17:32:01 1996 PST
11111111
Fri Feb 16 17:32:01 1996 PST
1112-
Mon Feb 16 17:32:01 0098 PST BC
1113-
Thu Feb 16 17:32:01 0096 PST
1114-
Tue Feb 16 17:32:01 0596 PST
1115-
Sun Feb 16 17:32:01 1096 PST
1116-
Thu Feb 16 17:32:01 1696 PST
1117-
Tue Feb 16 17:32:01 1796 PST
1112+
Mon Feb 16 17:32:01 0098 LMT BC
1113+
Thu Feb 16 17:32:01 0096 LMT
1114+
Tue Feb 16 17:32:01 0596 LMT
1115+
Sun Feb 16 17:32:01 1096 LMT
1116+
Thu Feb 16 17:32:01 1696 LMT
1117+
Tue Feb 16 17:32:01 1796 LMT
11181118
Sun Feb 16 17:32:01 1896 PST
11191119
Fri Feb 16 17:32:01 1996 PST
11201120
Thu Feb 16 17:32:01 2096 PST
@@ -2470,7 +2470,7 @@ SELECT '2020-10-05'::timestamptz > '2202020-10-05'::date as f;
24702470
SELECT '4714-11-24 BC'::date::timestamptz;
24712471
timestamptz
24722472
---------------------------------
2473-
Mon Nov 24 00:00:00 4714 PST BC
2473+
Mon Nov 24 00:00:00 4714 LMT BC
24742474
(1 row)
24752475

24762476
SET TimeZone = 'UTC-2';
@@ -3048,13 +3048,13 @@ RESET DateStyle;
30483048
SELECT to_timestamp('0097/Feb/16 --> 08:14:30', 'YYYY/Mon/DD --> HH:MI:SS');
30493049
to_timestamp
30503050
------------------------------
3051-
Sat Feb 16 08:14:30 0097 PST
3051+
Sat Feb 16 08:14:30 0097 LMT
30523052
(1 row)
30533053

30543054
SELECT to_timestamp('97/2/16 8:14:30', 'FMYYYY/FMMM/FMDD FMHH:FMMI:FMSS');
30553055
to_timestamp
30563056
------------------------------
3057-
Sat Feb 16 08:14:30 0097 PST
3057+
Sat Feb 16 08:14:30 0097 LMT
30583058
(1 row)
30593059

30603060
SELECT to_timestamp('2011$03!18 23_38_15', 'YYYY-MM-DD HH24:MI:SS');
@@ -3091,7 +3091,7 @@ SELECT to_timestamp('My birthday-> Year: 1976, Month: May, Day: 16',
30913091
SELECT to_timestamp('1,582nd VIII 21', 'Y,YYYth FMRM DD');
30923092
to_timestamp
30933093
------------------------------
3094-
Sat Aug 21 00:00:00 1582 PST
3094+
Sat Aug 21 00:00:00 1582 LMT
30953095
(1 row)
30963096

30973097
SELECT to_timestamp('15 "text between quote marks" 98 54 45',
@@ -3155,7 +3155,7 @@ SELECT to_timestamp('1997 AD 11 16', 'YYYY BC MM DD');
31553155
SELECT to_timestamp('1997 BC 11 16', 'YYYY BC MM DD');
31563156
to_timestamp
31573157
---------------------------------
3158-
Tue Nov 16 00:00:00 1997 PST BC
3158+
Tue Nov 16 00:00:00 1997 LMT BC
31593159
(1 row)
31603160

31613161
SELECT to_timestamp('1997 A.D. 11 16', 'YYYY B.C. MM DD');
@@ -3167,7 +3167,7 @@ SELECT to_timestamp('1997 A.D. 11 16', 'YYYY B.C. MM DD');
31673167
SELECT to_timestamp('1997 B.C. 11 16', 'YYYY B.C. MM DD');
31683168
to_timestamp
31693169
---------------------------------
3170-
Tue Nov 16 00:00:00 1997 PST BC
3170+
Tue Nov 16 00:00:00 1997 LMT BC
31713171
(1 row)
31723172

31733173
SELECT to_timestamp('9-1116', 'Y-MMDD');
@@ -3495,19 +3495,19 @@ SELECT to_date('-44-02-01 BC','YYYY-MM-DD BC');
34953495
SELECT to_timestamp('44-02-01 11:12:13 BC','YYYY-MM-DD HH24:MI:SS BC');
34963496
to_timestamp
34973497
---------------------------------
3498-
Fri Feb 01 11:12:13 0044 PST BC
3498+
Fri Feb 01 11:12:13 0044 LMT BC
34993499
(1 row)
35003500

35013501
SELECT to_timestamp('-44-02-01 11:12:13','YYYY-MM-DD HH24:MI:SS');
35023502
to_timestamp
35033503
---------------------------------
3504-
Fri Feb 01 11:12:13 0044 PST BC
3504+
Fri Feb 01 11:12:13 0044 LMT BC
35053505
(1 row)
35063506

35073507
SELECT to_timestamp('-44-02-01 11:12:13 BC','YYYY-MM-DD HH24:MI:SS BC');
35083508
to_timestamp
35093509
------------------------------
3510-
Mon Feb 01 11:12:13 0044 PST
3510+
Mon Feb 01 11:12:13 0044 LMT
35113511
(1 row)
35123512

35133513
--

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy