8000 Replace raw timezone source data with IANA's new compact format. · koderP/postgres@1a14b76 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1a14b76

Browse files
committed
Replace raw timezone source data with IANA's new compact format.
Traditionally IANA has distributed their timezone data in pure source form, replete with extensive historical comments. As of release 2017c, they've added a compact single-file format that omits comments and abbreviates command keywords. This form is way shorter than the pure source, even before considering its allegedly better compressibility. Hence, let's distribute the data in that form rather than pure source. I'm pushing this now, rather than at the next timezone database update, so that it's easy to confirm that this data file produces compiled zic output that's identical to what we were getting before. Discussion: https://postgr.es/m/1915.1511210334@sss.pgh.pa.us
1 parent 4722697 commit 1a14b76

16 files changed

+4160
-16523
lines changed

src/timezone/Makefile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,8 @@ OBJS= localtime.o strftime.o pgtz.o
2121
# files needed to build zic utility program
2222
ZICOBJS= zic.o $(WIN32RES)
2323

24-
# timezone data files
25-
TZDATA = africa antarctica asia australasia europe northamerica southamerica \
26-
pacificnew etcetera factory backward systemv
27-
TZDATAFILES = $(TZDATA:%=$(srcdir)/data/%)
24+
# we now distribute the timezone data as a single file
25+
TZDATAFILES = $(srcdir)/data/tzdata.zi
2826

2927
# which zone should determine the DST rules (not the specific UTC offset!)
3028
# for POSIX-style timezone specs

src/timezone/README

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@ src/timezone/README
22

33
This is a PostgreSQL adapted version of the IANA timezone library from
44

5-
http://www.iana.org/time-zones
5+
https://www.iana.org/time-zones
66

7-
The latest versions of both the tzdata and tzcode tarballs are normally
8-
available right from that page. Historical versions can be found
7+
The latest version of the timezone data and library source code is
8+
available right from that page. It's best to get the merged file
9+
tzdb-NNNNX.tar.lz, since the other archive formats omit tzdata.zi.
10+
Historical versions, as well as release announcements, can be found
911
elsewhere on the site.
1012

1113
Since time zone rules change frequently in some parts of the world,
@@ -17,11 +19,14 @@ changes that might affect interpretation of the data files.
1719
Time Zone data
1820
==============
1921

20-
The data files under data/ are an exact copy of the latest tzdata set,
21-
except that we omit some files that are not of interest for our purposes.
22+
We distribute the time zone source data as-is under src/timezone/data/.
23+
Currently, we distribute just the abbreviated single-file format
24+
"tzdata.zi", to reduce the size of our tarballs as well as churn
25+
in our git repo. Feeding that file to zic produces the same compiled
26+
output as feeding the bulkier individual data files would do.
2227

23-
While the files under data/ can just be duplicated when updating, manual
24-
effort is needed to update the time zone abbreviation lists under tznames/.
28+
While data/tzdata.zi can just be duplicated when updating, manual effort
29+
is needed to update the time zone abbreviation lists under tznames/.
2530
These need to be changed whenever new abbreviations are invented or the
2631
UTC offset associated with an existing abbreviation changes. To detect
2732
if this has happened, after installing new files under data/ do

0 commit comments

Comments
 (0)
0