Skip to content

Commit 0499bd2

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 27d3e76 commit 0499bd2

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
@@ -2365,3 +2365,18 @@ select count(distinct utc_offset) >= 24 as ok from pg_timezone_abbrevs;
23652365
t
23662366
(1 row)
23672367

2368+
-- Let's check the non-default timezone abbreviation sets, too
2369+
set timezone_abbreviations = 'Australia';
2370+
select count(distinct utc_offset) >= 24 as ok from pg_timezone_abbrevs;
2371+
ok
2372+
----
2373+
t
2374+
(1 row)
2375+
2376+
set timezone_abbreviations = 'India';
2377+
select count(distinct utc_offset) >= 24 as ok from pg_timezone_abbrevs;
2378+
ok
2379+
----
2380+
t
2381+
(1 row)
2382+

src/test/regress/sql/timestamptz.sql

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,3 +390,8 @@ SELECT '2007-12-09 07:30:00 UTC'::timestamptz AT TIME ZONE 'VET';
390390
--
391391
select count(distinct utc_offset) >= 24 as ok from pg_timezone_names;
392392
select count(distinct utc_offset) >= 24 as ok from pg_timezone_abbrevs;
393+
-- Let's check the non-default timezone abbreviation sets, too
394+
set timezone_abbreviations = 'Australia';
395+
select count(distinct utc_offset) >= 24 as ok from pg_timezone_abbrevs;
396+
set timezone_abbreviations = 'India';
397+
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)
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