postgresql/src/bin
Tom Lane 3754113f33 Avoid choosing "localtime" or "posixrules" as TimeZone during initdb.
Some platforms create a file named "localtime" in the system
timezone directory, making it a copy or link to the active time
zone file.  If Postgres is built with --with-system-tzdata, initdb
will see that file as an exact match to localtime(3)'s behavior,
and it may decide that "localtime" is the most preferred spelling of
the active zone.  That's a very bad choice though, because it's
neither informative, nor portable, nor stable if someone changes
the system timezone setting.  Extend the preference logic added by
commit e3846a00c so that we will prefer any other zone file that
matches localtime's behavior over "localtime".

On the same logic, also discriminate against "posixrules", which
is another not-really-a-zone file that is often present in the
timezone directory.  (Since we install "posixrules" but not
"localtime", this change can affect the behavior of Postgres
with or without --with-system-tzdata.)

Note that this change doesn't prevent anyone from choosing these
pseudo-zones if they really want to (i.e., by setting TZ for initdb,
or modifying the timezone GUC later on).  It just prevents initdb
from preferring these zone names when there are multiple matches to
localtime's behavior.

Since we generally prefer to keep timezone-related behavior the
same in all branches, and since this is arguably a bug fix,
back-patch to all supported branches.

Discussion: https://postgr.es/m/CADT4RqCCnj6FKLisvT8tTPfTP4azPhhDFJqDF1JfBbOH5w4oyQ@mail.gmail.com
Discussion: https://postgr.es/m/27991.1560984458@sss.pgh.pa.us
2019-07-26 12:45:32 -04:00
..
initdb Avoid choosing "localtime" or "posixrules" as TimeZone during initdb. 2019-07-26 12:45:32 -04:00
pg_archivecleanup Translation updates 2019-06-17 15:30:20 +02:00
pg_basebackup Fix compilation warning of pg_basebackup with MinGW 2019-07-21 22:27:11 +09:00
pg_checksums Message style improvements 2019-07-09 15:47:09 +02:00
pg_config Translation updates 2019-06-17 15:30:20 +02:00
pg_controldata Unwind some workarounds for lack of portable int64 format specifier 2019-07-04 17:01:43 +02:00
pg_ctl Fix failures to ignore \r when reading Windows-style newlines. 2019-07-25 12:11:17 -04:00
pg_dump Add CREATE DATABASE LOCALE option 2019-07-23 14:47:24 +02:00
pg_resetwal Fix failures to ignore \r when reading Windows-style newlines. 2019-07-25 12:11:17 -04:00
pg_rewind Unwind some workarounds for lack of portable int64 format specifier 2019-07-04 17:01:43 +02:00
pg_test_fsync Translation updates 2019-06-17 15:30:20 +02:00
pg_test_timing Unwind some workarounds for lack of portable int64 format specifier 2019-07-04 17:01:43 +02:00
pg_upgrade Fix failures to ignore \r when reading Windows-style newlines. 2019-07-25 12:11:17 -04:00
pg_waldump Translation updates 2019-06-17 15:30:20 +02:00
pgbench Don't assume expr is available in pgbench tests 2019-07-24 11:41:39 -04:00
pgevent Update copyright for 2019 2019-01-02 12:44:25 -05:00
psql Fix failures to ignore \r when reading Windows-style newlines. 2019-07-25 12:11:17 -04:00
scripts Remove more progname references in vacuumdb.c 2019-07-23 14:29:34 +09:00
Makefile Rename pg_verify_checksums to pg_checksums 2019-03-13 10:43:20 +09:00