From 66b737cd9a72e10df4de1867ae7b675bc48d478c Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Mon, 12 May 2014 20:21:16 -0400 Subject: [PATCH] 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. --- src/test/regress/expected/timestamptz.out | 16 +++++----------- src/test/regress/sql/timestamptz.sql | 7 +++---- 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/src/test/regress/expected/timestamptz.out b/src/test/regress/expected/timestamptz.out index 33dfa5916e..f95617b01a 100644 --- a/src/test/regress/expected/timestamptz.out +++ b/src/test/regress/expected/timestamptz.out @@ -1758,7 +1758,7 @@ SELECT make_timestamptz(1973, 07, 15, 08, 15, 55.33, '+2') = '1973-07-15 08:15:5 t (1 row) --- full timezone name +-- full timezone names SELECT make_timestamptz(2014, 12, 10, 0, 0, 0, 'Europe/Prague') = timestamptz '2014-12-10 00:00:00 Europe/Prague'; ?column? ---------- @@ -1777,20 +1777,14 @@ SELECT make_timestamptz(1846, 12, 10, 0, 0, 0, 'Asia/Manila') AT TIME ZONE 'UTC' Wed Dec 09 15:56:00 1846 (1 row) -SELECT make_timestamptz(1866, 12, 10, 0, 0, 0, 'America/Metlakatla') AT TIME ZONE 'UTC'; +SELECT make_timestamptz(1881, 12, 10, 0, 0, 0, 'Europe/Paris') AT TIME ZONE 'UTC'; timezone -------------------------- - Sun Dec 09 08:46:18 1866 + Fri Dec 09 23:50:39 1881 (1 row) -SELECT make_timestamptz(1901, 12, 10, 0, 0, 0, 'America/Metlakatla') AT TIME ZONE 'UTC'; - timezone --------------------------- - Tue Dec 10 08:00:00 1901 -(1 row) - -SELECT make_timestamptz(2014, 12, 10, 0, 0, 0, 'Mars/Mons_Olympus'); -ERROR: time zone "Mars/Mons_Olympus" not recognized +SELECT make_timestamptz(1910, 12, 24, 0, 0, 0, 'Nehwon/Lankhmar'); +ERROR: time zone "Nehwon/Lankhmar" not recognized -- abbreviations SELECT make_timestamptz(2008, 12, 10, 10, 10, 10, 'CLST'); make_timestamptz diff --git a/src/test/regress/sql/timestamptz.sql b/src/test/regress/sql/timestamptz.sql index 3ddf38c985..ec001f85f3 100644 --- a/src/test/regress/sql/timestamptz.sql +++ b/src/test/regress/sql/timestamptz.sql @@ -277,13 +277,12 @@ SELECT make_timestamptz(2014, 12, 10, 10, 10, 10, '-16'); -- should be true SELECT make_timestamptz(1973, 07, 15, 08, 15, 55.33, '+2') = '1973-07-15 08:15:55.33+02'::timestamptz; --- full timezone name +-- full timezone names SELECT make_timestamptz(2014, 12, 10, 0, 0, 0, 'Europe/Prague') = timestamptz '2014-12-10 00:00:00 Europe/Prague'; SELECT make_timestamptz(2014, 12, 10, 0, 0, 0, 'Europe/Prague') AT TIME ZONE 'UTC'; SELECT make_timestamptz(1846, 12, 10, 0, 0, 0, 'Asia/Manila') AT TIME ZONE 'UTC'; -SELECT make_timestamptz(1866, 12, 10, 0, 0, 0, 'America/Metlakatla') AT TIME ZONE 'UTC'; -SELECT make_timestamptz(1901, 12, 10, 0, 0, 0, 'America/Metlakatla') AT TIME ZONE 'UTC'; -SELECT make_timestamptz(2014, 12, 10, 0, 0, 0, 'Mars/Mons_Olympus'); +SELECT make_timestamptz(1881, 12, 10, 0, 0, 0, 'Europe/Paris') AT TIME ZONE 'UTC'; +SELECT make_timestamptz(1910, 12, 24, 0, 0, 0, 'Nehwon/Lankhmar'); -- abbreviations SELECT make_timestamptz(2008, 12, 10, 10, 10, 10, 'CLST'); -- 2.40.0