Skip to content

Commit 66b737c

Browse files
committed
Be more wary in choice of timezone names to test make_timestamptz with.
America/Metlakatla hasn't been in the IANA database all that long, so some installations might not have it. It does seem worthwhile to test with a fractional-minute GMT offset, but we can get that from almost any pre-1900 date; I chose Europe/Paris, whose LMT offset from Greenwich should be pretty darn well established. Also, assuming that Mars/Mons_Olympus will never be in the IANA database seems less than future-proof, so let's use a more fanciful location for the bad-zone-name check. Per complaint from Christoph Berg.
1 parent 73011f3 commit 66b737c

File tree

2 files changed

+8
-15
lines changed

2 files changed

+8
-15
lines changed

src/test/regress/expected/timestamptz.out

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1758,7 +1758,7 @@ SELECT make_timestamptz(1973, 07, 15, 08, 15, 55.33, '+2') = '1973-07-15 08:15:5
17581758
t
17591759
(1 row)
17601760

1761-
-- full timezone name
1761+
-- full timezone names
17621762
SELECT make_timestamptz(2014, 12, 10, 0, 0, 0, 'Europe/Prague') = timestamptz '2014-12-10 00:00:00 Europe/Prague';
17631763
?column?
17641764
----------
@@ -1777,20 +1777,14 @@ SELECT make_timestamptz(1846, 12, 10, 0, 0, 0, 'Asia/Manila') AT TIME ZONE 'UTC'
17771777
Wed Dec 09 15:56:00 1846
17781778
(1 row)
17791779

1780-
SELECT make_timestamptz(1866, 12, 10, 0, 0, 0, 'America/Metlakatla') AT TIME ZONE 'UTC';
1780+
SELECT make_timestamptz(1881, 12, 10, 0, 0, 0, 'Europe/Paris') AT TIME ZONE 'UTC';
17811781
timezone
17821782
--------------------------
1783-
Sun Dec 09 08:46:18 1866
1783+
Fri Dec 09 23:50:39 1881
17841784
(1 row)
17851785

1786-
SELECT make_timestamptz(1901, 12, 10, 0, 0, 0, 'America/Metlakatla') AT TIME ZONE 'UTC';
1787-
timezone
1788-
--------------------------
1789-
Tue Dec 10 08:00:00 1901
1790-
(1 row)
1791-
1792-
SELECT make_timestamptz(2014, 12, 10, 0, 0, 0, 'Mars/Mons_Olympus');
1793-
ERROR: time zone "Mars/Mons_Olympus" not recognized
1786+
SELECT make_timestamptz(1910, 12, 24, 0, 0, 0, 'Nehwon/Lankhmar');
1787+
ERROR: time zone "Nehwon/Lankhmar" not recognized
17941788
-- abbreviations
17951789
SELECT make_timestamptz(2008, 12, 10, 10, 10, 10, 'CLST');
17961790
make_timestamptz

src/test/regress/sql/timestamptz.sql

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -277,13 +277,12 @@ SELECT make_timestamptz(2014, 12, 10, 10, 10, 10, '-16');
277277
-- should be true
278278
SELECT make_timestamptz(1973, 07, 15, 08, 15, 55.33, '+2') = '1973-07-15 08:15:55.33+02'::timestamptz;
279279

280-
-- full timezone name
280+
-- full timezone names
281281
SELECT make_timestamptz(2014, 12, 10, 0, 0, 0, 'Europe/Prague') = timestamptz '2014-12-10 00:00:00 Europe/Prague';
282282
SELECT make_timestamptz(2014, 12, 10, 0, 0, 0, 'Europe/Prague') AT TIME ZONE 'UTC';
283283
SELECT make_timestamptz(1846, 12, 10, 0, 0, 0, 'Asia/Manila') AT TIME ZONE 'UTC';
284-
SELECT make_timestamptz(1866, 12, 10, 0, 0, 0, 'America/Metlakatla') AT TIME ZONE 'UTC';
285-
SELECT make_timestamptz(1901, 12, 10, 0, 0, 0, 'America/Metlakatla') AT TIME ZONE 'UTC';
286-
SELECT make_timestamptz(2014, 12, 10, 0, 0, 0, 'Mars/Mons_Olympus');
284+
SELECT make_timestamptz(1881, 12, 10, 0, 0, 0, 'Europe/Paris') AT TIME ZONE 'UTC';
285+
SELECT make_timestamptz(1910, 12, 24, 0, 0, 0, 'Nehwon/Lankhmar');
287286

288287
-- abbreviations
289288
SELECT make_timestamptz(2008, 12, 10, 10, 10, 10, 'CLST');

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