Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit c7f68be

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 da6ea70 commit c7f68be

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed

src/test/regress/expected/timestamptz.out

+15
Original file line numberDiff line numberDiff line change
@@ -2623,3 +2623,18 @@ select count(distinct utc_offset) >= 24 as ok from pg_timezone_abbrevs;
26232623
t
26242624
(1 row)
26252625

2626+
-- Let's check the non-default timezone abbreviation sets, too
2627+
set timezone_abbreviations = 'Australia';
2628+
select count(distinct utc_offset) >= 24 as ok from pg_timezone_abbrevs;
2629+
ok
2630+
----
2631+
t
2632+
(1 row)
2633+
2634+
set timezone_abbreviations = 'India';
2635+
select count(distinct utc_offset) >= 24 as ok from pg_timezone_abbrevs;
2636+
ok
2637+
----
2638+
t
2639+
(1 row)
2640+

src/test/regress/sql/timestamptz.sql

+5
Original file line numberDiff line numberDiff line change
@@ -479,3 +479,8 @@ SELECT '2007-12-09 07:30:00 UTC'::timestamptz AT TIME ZONE 'VET';
479479
--
480480
select count(distinct utc_offset) >= 24 as ok from pg_timezone_names;
481481
select count(distinct utc_offset) >= 24 as ok from pg_timezone_abbrevs;
482+
-- Let's check the non-default timezone abbreviation sets, too
483+
set timezone_abbreviations = 'Australia';
484+
select count(distinct utc_offset) >= 24 as ok from pg_timezone_abbrevs;
485+
set timezone_abbreviations = 'India';
486+
select count(distinct utc_offset) >= 24 as ok from pg_timezone_abbrevs;

src/timezone/README

+5
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)