Skip to content

Commit 8108674

Browse files
committed
Avoid using timezone Asia/Manila in regression tests.
The freshly-released 2025a version of tzdata has a refined estimate for the longitude of Manila, changing their value for LMT in pre-standardized-timezone days. This changes the output of one of our test cases. Since we need to be able to run with system tzdata files that may or may not contain this update, we'd better stop making that specific test. I switched it to use Asia/Singapore, which has a roughly similar UTC offset. That LMT value hasn't changed in tzdb since 2003, so we can hope that it's well established. I also noticed that this set of make_timestamptz tests only exercises zones east of Greenwich, which seems rather sad, and was not the original intent AFAICS. (We've already changed these tests once to stabilize their results across tzdata updates, cf 66b737c; it looks like I failed to consider the UTC-offset-sign aspect then.) To improve that, add a test with Pacific/Honolulu. That LMT offset is also quite old in tzdb, so we'll cross our fingers that it doesn't get improved. Reported-by: Christoph Berg <cb@df7cb.de> Discussion: https://postgr.es/m/Z46inkznCxesvDEb@msg.df7cb.de Backpatch-through: 13
1 parent 86749ea commit 8108674

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

src/include/datatype/timestamp.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ struct pg_itm_in
136136
/*
137137
* We allow numeric timezone offsets up to 15:59:59 either way from Greenwich.
138138
* Currently, the record holders for wackiest offsets in actual use are zones
139-
* Asia/Manila, at -15:56:00 until 1844, and America/Metlakatla, at +15:13:42
139+
* Asia/Manila, at -15:56:08 until 1844, and America/Metlakatla, at +15:13:42
140140
* until 1867. If we were to reject such values we would fail to dump and
141141
* restore old timestamptz values with these zone settings.
142142
*/

src/test/regress/expected/timestamptz.out

+8-2
Original file line numberDiff line numberDiff line change
@@ -2451,10 +2451,16 @@ SELECT make_timestamptz(2014, 12, 10, 0, 0, 0, 'Europe/Prague') AT TIME ZONE 'UT
24512451
Tue Dec 09 23:00:00 2014
24522452
(1 row)
24532453

2454-
SELECT make_timestamptz(1846, 12, 10, 0, 0, 0, 'Asia/Manila') AT TIME ZONE 'UTC';
2454+
SELECT make_timestamptz(1881, 12, 10, 0, 0, 0, 'Asia/Singapore') AT TIME ZONE 'UTC';
24552455
timezone
24562456
--------------------------
2457-
Wed Dec 09 15:56:00 1846
2457+
Fri Dec 09 17:04:35 1881
2458+
(1 row)
2459+
2460+
SELECT make_timestamptz(1881, 12, 10, 0, 0, 0, 'Pacific/Honolulu') AT TIME ZONE 'UTC';
2461+
timezone
2462+
--------------------------
2463+
Sat Dec 10 10:31:26 1881
24582464
(1 row)
24592465

24602466
SELECT make_timestamptz(1881, 12, 10, 0, 0, 0, 'Europe/Paris') AT TIME ZONE 'UTC';

src/test/regress/sql/timestamptz.sql

+2-1
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,8 @@ SELECT make_timestamptz(1973, 07, 15, 08, 15, 55.33, '+2') = '1973-07-15 08:15:5
463463
-- full timezone names
464464
SELECT make_timestamptz(2014, 12, 10, 0, 0, 0, 'Europe/Prague') = timestamptz '2014-12-10 00:00:00 Europe/Prague';
465465
SELECT make_timestamptz(2014, 12, 10, 0, 0, 0, 'Europe/Prague') AT TIME ZONE 'UTC';
466-
SELECT make_timestamptz(1846, 12, 10, 0, 0, 0, 'Asia/Manila') AT TIME ZONE 'UTC';
466+
SELECT make_timestamptz(1881, 12, 10, 0, 0, 0, 'Asia/Singapore') AT TIME ZONE 'UTC';
467+
SELECT make_timestamptz(1881, 12, 10, 0, 0, 0, 'Pacific/Honolulu') AT TIME ZONE 'UTC';
467468
SELECT make_timestamptz(1881, 12, 10, 0, 0, 0, 'Europe/Paris') AT TIME ZONE 'UTC';
468469
SELECT make_timestamptz(1910, 12, 24, 0, 0, 0, 'Nehwon/Lankhmar');
469470

0 commit comments

Comments
 (0)