diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2016-07-19 15:59:36 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2016-07-19 15:59:36 -0400 |
commit | 19d477aa681b4927f95824d724a4197c696f8c75 (patch) | |
tree | 4795da77200eb86060bef5e637190e03de6081a4 /src/timezone/tzfile.h | |
parent | bdeed0944fadff3ea394d361d0137997fb4db953 (diff) | |
download | postgresql-19d477aa681b4927f95824d724a4197c696f8c75.tar.gz postgresql-19d477aa681b4927f95824d724a4197c696f8c75.zip |
Sync back-branch copies of the timezone code with IANA release tzcode2016c.
Back-patch commit 1c1a7cbd6a1600c9, along with subsequent portability
fixes, into all active branches. Also, back-patch commits 696027727 and
596857043 (addition of zic -P option) into 9.1 and 9.2, just to reduce
differences between the branches. src/timezone/ is now largely identical
in all active branches, except that in 9.1, pgtz.c retains the
initial-timezone-selection code that was moved over to initdb in 9.2.
Ordinarily we wouldn't risk this much code churn in back branches, but it
seems necessary in this case, because among the changes are two feature
additions in the "zic" zone data file compiler (a larger limit on the
number of allowed DST transitions, and addition of a "%z" escape in zone
abbreviations). IANA have not yet started to use those features in their
tzdata files, but presumably they will before too long. If we don't update
then we'll be unable to adopt new timezone data. Also, installations built
with --with-system-tzdata (which includes most distro-supplied builds, I
believe) might fail even if we don't update our copies of the data files.
There are assorted bug fixes too, mostly affecting obscure timezones or
post-2037 dates.
Discussion: <13601.1468868947@sss.pgh.pa.us>
Diffstat (limited to 'src/timezone/tzfile.h')
-rw-r--r-- | src/timezone/tzfile.h | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/src/timezone/tzfile.h b/src/timezone/tzfile.h index 065db9032ee..32d237b8270 100644 --- a/src/timezone/tzfile.h +++ b/src/timezone/tzfile.h @@ -33,8 +33,8 @@ struct tzhead { char tzh_magic[4]; /* TZ_MAGIC */ - char tzh_version[1]; /* '\0' or '2' as of 2005 */ - char tzh_reserved[15]; /* reserved--must be zero */ + char tzh_version[1]; /* '\0' or '2' or '3' as of 2013 */ + char tzh_reserved[15]; /* reserved; must be zero */ char tzh_ttisgmtcnt[4]; /* coded number of trans. time flags */ char tzh_ttisstdcnt[4]; /* coded number of trans. time flags */ char tzh_leapcnt[4]; /* coded number of leap seconds */ @@ -43,30 +43,29 @@ struct tzhead char tzh_charcnt[4]; /* coded number of abbr. chars */ }; -/*---------- +/* * . . .followed by. . . * * tzh_timecnt (char [4])s coded transition times a la time(2) * tzh_timecnt (unsigned char)s types of local time starting at above * tzh_typecnt repetitions of - * one (char [4]) coded UTC offset in seconds + * one (char [4]) coded UT offset in seconds * one (unsigned char) used to set tm_isdst * one (unsigned char) that's an abbreviation list index * tzh_charcnt (char)s '\0'-terminated zone abbreviations * tzh_leapcnt repetitions of * one (char [4]) coded leap second transition times * one (char [4]) total correction after above - * tzh_ttisstdcnt (char)s indexed by type; if TRUE, transition - * time is standard time, if FALSE, + * tzh_ttisstdcnt (char)s indexed by type; if 1, transition + * time is standard time, if 0, * transition time is wall clock time * if absent, transition times are * assumed to be wall clock time - * tzh_ttisgmtcnt (char)s indexed by type; if TRUE, transition - * time is UTC, if FALSE, + * tzh_ttisgmtcnt (char)s indexed by type; if 1, transition + * time is UT, if 0, * transition time is local time * if absent, transition times are * assumed to be local time - *---------- */ /* @@ -77,6 +76,13 @@ struct tzhead * instants after the last transition time stored in the file * (with nothing between the newlines if there is no POSIX representation for * such instants). + * + * If tz_version is '3' or greater, the above is extended as follows. + * First, the POSIX TZ string's hour offset may range from -167 + * through 167 as compared to the POSIX-required 0 through 24. + * Second, its DST start time may be January 1 at 00:00 and its stop + * time December 31 at 24:00 plus the difference between DST and + * standard time, indicating DST all year. */ /* @@ -84,8 +90,9 @@ struct tzhead * exceed any of the limits below. */ -#define TZ_MAX_TIMES 1200 +#define TZ_MAX_TIMES 2000 +/* This must be at least 17 for Europe/Samara and Europe/Vilnius. */ #define TZ_MAX_TYPES 256 /* Limited by what (unsigned char)'s can hold */ #define TZ_MAX_CHARS 50 /* Maximum number of abbreviation characters */ @@ -100,7 +107,7 @@ struct tzhead #define DAYSPERNYEAR 365 #define DAYSPERLYEAR 366 #define SECSPERHOUR (SECSPERMIN * MINSPERHOUR) -#define SECSPERDAY ((long) SECSPERHOUR * HOURSPERDAY) +#define SECSPERDAY ((int32) SECSPERHOUR * HOURSPERDAY) #define MONSPERYEAR 12 #define TM_SUNDAY 0 @@ -143,6 +150,6 @@ struct tzhead * We use this to avoid addition overflow problems. */ -#define isleap_sum(a, b) isleap((a) % 400 + (b) % 400) +#define isleap_sum(a, b) isleap((a) % 400 + (b) % 400) #endif /* !defined TZFILE_H */ |