Skip to content

Commit 0ce0801

Browse files
committed
Add regression test coverage for non-default timezone abbreviation sets.
After further reflection about the mess cleaned up in commit 39b691f, 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.
1 parent c26a3ab commit 0ce0801

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed

src/test/regress/expected/timestamptz.out

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2558,3 +2558,18 @@ select count(distinct utc_offset) >= 24 as ok from pg_timezone_abbrevs;
25582558
t
25592559
(1 row)
25602560

2561+
-- Let's check the non-default timezone abbreviation sets, too
2562+
set timezone_abbreviations = 'Australia';
2563+
select count(distinct utc_offset) >= 24 as ok from pg_timezone_abbrevs;
2564+
ok
2565+
----
2566+
t
2567+
(1 row)
2568+
2569+
set timezone_abbreviations = 'India';
2570+
select count(distinct utc_offset) >= 24 as ok from pg_timezone_abbrevs;
2571+
ok
2572+
----
2573+
t
2574+
(1 row)
2575+

src/test/regress/sql/timestamptz.sql

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,3 +460,8 @@ SELECT '2007-12-09 07:30:00 UTC'::timestamptz AT TIME ZONE 'VET';
460460
--
461461
select count(distinct utc_offset) >= 24 as ok from pg_timezone_names;
462462
select count(distinct utc_offset) >= 24 as ok from pg_timezone_abbrevs;
463+
-- Let's check the non-default timezone abbreviation sets, too
464+
set timezone_abbreviations = 'Australia';
465+
select count(distinct utc_offset) >= 24 as ok from pg_timezone_abbrevs;
466+
set timezone_abbreviations = 'India';
467+
select count(distinct utc_offset) >= 24 as ok from pg_timezone_abbrevs;

src/timezone/README

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ in the same commit. Usually, if a known abbreviation has changed meaning,
3434
the appropriate fix is to make it refer to a long-form zone name instead
3535
of a fixed GMT offset.
3636

37+
The core regression test suite does some simple validation of the zone
38+
data and abbreviations data (notably by checking that the pg_timezone_names
39+
and pg_timezone_abbrevs views don't throw errors). It's worth running it
40+
as a cross-check on proposed updates.
41+
3742
When there has been a new release of Windows (probably including Service
3843
Packs), the list of matching timezones need to be updated. Run the
3944
script in src/tools/win32tzlist.pl on a Windows machine running this new

0 commit comments

Comments
 (0)