]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Future-proof regression tests against possibly-missing posixrules file.
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 19 Jun 2020 17:55:21 +0000 (13:55 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 19 Jun 2020 17:55:21 +0000 (13:55 -0400)
commit34ef5863c77bb070a6faf136a06728961d6e2a72
tree92d1d31417bffe3b5aa20543bb6255760a39a3bd
parentf7aefd5158ffea5f5c7b2828658287719d5163d3
Future-proof regression tests against possibly-missing posixrules file.

The IANA time zone folk have deprecated use of a "posixrules" file in
the tz database.  While for now it's our choice whether to keep
supplying one in our own builds, installations built with
--with-system-tzdata will soon be needing to cope with that file not
being present, at least on some platforms.

This causes a problem for the horology test, which expected the
nonstandard POSIX zone spec "CST7CDT" to apply pre-2007 US daylight
savings rules.  That does happen if the posixrules file supplies such
information, but otherwise the test produces undesired results.
To fix, add an explicit transition date rule that matches 2005 practice.
(We could alternatively have switched the test to use some real time
zone, but it seems useful to have coverage of this type of zone spec.)

While at it, update a documentation example that also relied on
"CST7CDT"; use a real-world zone name instead.  Also, document why
the zone names EST5EDT, CST6CDT, MST7MDT, PST8PDT aren't subject to
similar failures when "posixrules" is missing.

Back-patch to all supported branches, since the hazard is the same
for all.

Discussion: https://postgr.es/m/1665379.1592581287@sss.pgh.pa.us
doc/src/sgml/datetime.sgml
doc/src/sgml/func.sgml
src/test/regress/expected/horology.out
src/test/regress/sql/horology.sql