diff options
author | Tom Lane | 2016-09-05 00:02:17 +0000 |
---|---|---|
committer | Tom Lane | 2016-09-05 00:02:17 +0000 |
commit | 0499bd26915f2b4119560142855db3df59d1b8a4 (patch) | |
tree | 3ce97bdc7153e6077277bf9e33582bba8aecafa5 | |
parent | 27d3e766cff0b6e0a5c3f8f09218c02db43bd5a1 (diff) |
Add regression test coverage for non-default timezone abbreviation sets.
After further reflection about the mess cleaned up in commit 39b691f25,
I decided the main bit of test coverage that was still missing was to
check that the non-default abbreviation-set files we supply are usable.
Add that.
Back-patch to supported branches, just because it seems like a good
idea to keep this all in sync.
-rw-r--r-- | src/test/regress/expected/timestamptz.out | 15 | ||||
-rw-r--r-- | src/test/regress/sql/timestamptz.sql | 5 | ||||
-rw-r--r-- | src/timezone/README | 5 |
3 files changed, 25 insertions, 0 deletions
diff --git a/src/test/regress/expected/timestamptz.out b/src/test/regress/expected/timestamptz.out index e8e7a8508e2..1a781a056e3 100644 --- a/src/test/regress/expected/timestamptz.out +++ b/src/test/regress/expected/timestamptz.out @@ -2365,3 +2365,18 @@ select count(distinct utc_offset) >= 24 as ok from pg_timezone_abbrevs; t (1 row) +-- Let's check the non-default timezone abbreviation sets, too +set timezone_abbreviations = 'Australia'; +select count(distinct utc_offset) >= 24 as ok from pg_timezone_abbrevs; + ok +---- + t +(1 row) + +set timezone_abbreviations = 'India'; +select count(distinct utc_offset) >= 24 as ok from pg_timezone_abbrevs; + ok +---- + t +(1 row) + diff --git a/src/test/regress/sql/timestamptz.sql b/src/test/regress/sql/timestamptz.sql index 42fbba8b5d4..30c794a5d10 100644 --- a/src/test/regress/sql/timestamptz.sql +++ b/src/test/regress/sql/timestamptz.sql @@ -390,3 +390,8 @@ SELECT '2007-12-09 07:30:00 UTC'::timestamptz AT TIME ZONE 'VET'; -- select count(distinct utc_offset) >= 24 as ok from pg_timezone_names; select count(distinct utc_offset) >= 24 as ok from pg_timezone_abbrevs; +-- Let's check the non-default timezone abbreviation sets, too +set timezone_abbreviations = 'Australia'; +select count(distinct utc_offset) >= 24 as ok from pg_timezone_abbrevs; +set timezone_abbreviations = 'India'; +select count(distinct utc_offset) >= 24 as ok from pg_timezone_abbrevs; diff --git a/src/timezone/README b/src/timezone/README index 1df4ce1f69a..f2f80c7176a 100644 --- a/src/timezone/README +++ b/src/timezone/README @@ -34,6 +34,11 @@ in the same commit. Usually, if a known abbreviation has changed meaning, the appropriate fix is to make it refer to a long-form zone name instead of a fixed GMT offset. +The core regression test suite does some simple validation of the zone +data and abbreviations data (notably by checking that the pg_timezone_names +and pg_timezone_abbrevs views don't throw errors). It's worth running it +as a cross-check on proposed updates. + When there has been a new release of Windows (probably including Service Packs), the list of matching timezones need to be updated. Run the script in src/tools/win32tzlist.pl on a Windows machine running this new |