Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0499bd2

Browse files
committed
Add regression test coverage for non-default timezone abbreviation sets.
After further reflection about the mess cleaned up in commit39b691f,I decided the main bit of test coverage that was still missing was tocheck that the non-default abbreviation-set files we supply are usable.Add that.Back-patch to supported branches, just because it seems like a goodidea to keep this all in sync.
1 parent27d3e76 commit0499bd2

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
selectcount(distinct utc_offset)>=24as okfrom pg_timezone_names;
392392
selectcount(distinct utc_offset)>=24as okfrom pg_timezone_abbrevs;
393+
-- Let's check the non-default timezone abbreviation sets, too
394+
set timezone_abbreviations='Australia';
395+
selectcount(distinct utc_offset)>=24as okfrom pg_timezone_abbrevs;
396+
set timezone_abbreviations='India';
397+
selectcount(distinct utc_offset)>=24as okfrom 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)

[8]ページ先頭

©2009-2025 Movatter.jp