postgresql/src
Andrew Gierth 7f28fc8e92 Prefer timezone name "UTC" over alternative spellings.
tzdb 2019a made "UCT" a link to the "UTC" zone rather than a separate
zone with its own abbreviation. Unfortunately, our code for choosing a
timezone in initdb has an arbitrary preference for names earlier in
the alphabet, and so it would choose the spelling "UCT" over "UTC"
when the system is running on a UTC zone.

Commit 23bd3cec6 was backpatched in order to address this issue, but
that code helps only when /etc/localtime exists as a symlink, and does
nothing to help on systems where /etc/localtime is a copy of a zone
file (as is the standard setup on FreeBSD and probably some other
platforms too) or when /etc/localtime is simply absent (giving UTC as
the default).

Accordingly, add a preference for the spelling "UTC", such that if
multiple zone names have equally good content matches, we prefer that
name before applying the existing arbitrary rules. Also add a slightly
lower preference for "Etc/UTC"; lower because that preserves the
previous behaviour of choosing the shorter name, but letting us still
choose "Etc/UTC" over "Etc/UCT" when both exist but "UTC" does
not (not common, but I've seen it happen).

Backpatch all the way, because the tzdb change that sparked this issue
is in those branches too.
2019-06-15 18:16:43 +01:00
..
backend Silence compiler warning 2019-06-14 11:33:40 -04:00
bin Prefer timezone name "UTC" over alternative spellings. 2019-06-15 18:16:43 +01:00
common Tolerate EINVAL when calling fsync() on a directory. 2019-02-24 23:51:54 +13:00
fe_utils Fix translation of special characters in psql's LaTeX output modes. 2018-11-26 17:32:51 -05:00
include Mark ReplicationSlotCtl as PGDLLIMPORT. 2019-06-13 10:53:17 -04:00
interfaces Attempt to identify system timezone by reading /etc/localtime symlink. 2019-06-14 11:25:13 -04:00
makefiles Define WIN32_STACK_RLIMIT throughout win32 and cygwin builds. 2019-04-09 08:25:42 -07:00
pl Fix C++ incompatibilities in plpgsql's header files. 2019-05-31 12:34:54 -04:00
port Stamp 11.3. 2019-05-06 16:46:18 -04:00
template Yet further rethinking of build changes for macOS Mojave. 2018-11-02 18:54:00 -04:00
test Avoid spurious deadlocks when upgrading a tuple lock 2019-06-13 17:28:24 -04:00
timezone Portability fix for zic.c. 2019-04-26 21:20:21 -04:00
tools In the pg_upgrade test suite, don't write to src/test/regress. 2019-05-28 12:59:36 -07:00
tutorial Update copyright for 2018 2018-01-02 23:30:12 -05:00
.gitignore
DEVELOPERS
Makefile Fix partial-build problems introduced by having more generated headers. 2018-04-09 16:42:10 -04:00
Makefile.global.in Consistently test for in-use shared memory. 2019-04-12 22:36:42 -07:00
Makefile.shlib Ensure static libraries have correct mod time even if ranlib messes it up. 2018-11-29 15:53:44 -05:00
nls-global.mk nls-global.mk: search build dir for source files, too 2016-06-07 18:55:18 -04:00