Updating our timezone code in the back branches

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-hackers(at)postgreSQL(dot)org
Subject: Updating our timezone code in the back branches
Date: 2016-07-18 19:09:07
Message-ID: 13601.1468868947@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

When I updated our copy of the IANA timezone library back in March
(commit 1c1a7cbd6), I noted that we ought to consider back-patching
those changes once they'd settled out in HEAD. Now that the code
has survived a couple of months of beta testing, I think it is time
to do that.

I went through the IANA announcement archives
http://mm.icann.org/pipermail/tz-announce/
to get a summary of what's changed since the tzcode 2010c release
that we last synced with. Attached is a list of code changes that
seem potentially significant to us. There are at least two ticking
time bombs in there, namely zic feature additions that IANA has not
yet started to use in the tzdata files, but presumably will start
using at some point, else why would they put them in? (These are
the extension to allow four DST transitions per year and the addition
of %z escapes in TZ abbreviations.) Whenever they do start using them,
we'll be unable to apply tzdata updates to unpatched back branches,
because our old copy of zic will fail to compile the tzdata files.

There are also several bug fixes that affect interpretation of dates after
2037, a year that's getting closer all the time. And there are some
changes that affect reading of zic data files, which could affect
unpatched back branches that are built with --with-system-tzdata,
since those might be fed updated data files even if we do nothing.

So I think it behooves us to apply these changes to the back branches
while we can still do it in a leisurely fashion, rather than waiting
until our hands are forced. I'd like to do it in the next week or so
so that we can get in a little bit of buildfarm and manual testing
before the next set of back-branch releases in August.

Thoughts, objections?

regards, tom lane

tzcode release 2013a

The zone offset at the end of version-2-format zone files is now
allowed to be 24:00, as per POSIX.1-2008.

Fix zic bug that mishandled Egypt's 2010 changes (this also affected
the data).

2013e

Allow POSIX-like TZ strings where the transition time's hour can
range from -167 through 167, instead of the POSIX-required 0
through 24. E.g., TZ='FJT-12FJST,M10.3.1/146,M1.3.4/75' for the
new Fiji rules. This is a more-compact way to represent
far-future time stamps for America/Godthab, America/Santiago,
Antarctica/Palmer, Asia/Gaza, Asia/Hebron, Asia/Jerusalem,
Pacific/Easter, and Pacific/Fiji. Other zones are unaffected by
this change.

Allow POSIX-like TZ strings where daylight saving time is in
effect all year. E.g., TZ='WART4WARST,J1/0,J365/25' for Western
Argentina Summer Time all year. This supports a more-compact way
to represent the 2013d data for America/Argentina/San_Luis.
Because of the change for San Luis noted above this change does not
affect the current data.

Where these two TZ changes take effect, there is a minor extension
to the tz file format in that it allows new values for the
embedded TZ-format string, and the tz file format version number
has therefore been increased from 2 to 3 as a precaution.
Version-2-based client code should continue to work as before for
all time stamps before 2038. Existing version-2-based client code
(tzcode, GNU/Linux, Solaris) has been tested on version-3-format
files, and typically works in practice even for time stamps after
2037; the only known exception is America/Godthab.

2014b

'zic' and 'localtime' no longer reject locations needing four
transitions per year for the forseeable future. (Needed for
planned changes to make Antarctica/Troll zone more accurate)

2014c

zic now generates transitions for minimum time values, eliminating
guesswork when handling low-valued time stamps.

2015f

The two characters '%z' in a zone format now stand for the UTC
offset, e.g., '-07' for seven hours behind UTC and '+0530' for
five hours and thirty minutes ahead. This better supports time
zone abbreviations conforming to POSIX.1-2001 and later.

zdump and zic no longer warn about valid time zone abbreviations
like '-05'. (We were forced to apply this change already, cf
221619ad6)

localtime no longer mishandles America/Anchorage after 2037.

not yet applied to PG:

2016e

zic now outputs a dummy transition at time 2**31 - 1 in zones
whose POSIX-style TZ strings contain a '<'. This mostly works
around Qt bug 53071 <https://bugreports.qt.io/browse/QTBUG-53071>.

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2016-07-18 19:44:35 Re: One process per session lack of sharing
Previous Message Piotr Stefaniak 2016-07-18 19:00:19 Re: More parallel-query fun