Re: UCT (Re: pgsql: Update time zone data files to tzdata release 2019a.)

Andres Freund <andres@anarazel.de>

From: Andres Freund <andres@anarazel.de>
To: Andrew Gierth <andrew@tao11.riddles.org.uk>
Cc: Christoph Berg <myon@debian.org>, Tom Lane <tgl@sss.pgh.pa.us>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2019-06-04T16:44:57Z
Lists: pgsql-hackers
Hi,

On 2019-06-04 17:20:42 +0100, Andrew Gierth wrote:
> fwiw on FreeBSD with no /etc/localtime and no TZ in the environment (and
> hence running on UTC), I get "UCT" on both 11.3 and HEAD.

That makes sense. As far as I can tell the reason that 12 sometimes ends
up with the proper timezone is that we shortcut the search by:

	/*
	 * Try to avoid the brute-force search by seeing if we can recognize the
	 * system's timezone setting directly.
	 *
	 * Currently we just check /etc/localtime; there are other conventions for
	 * this, but that seems to be the only one used on enough platforms to be
	 * worth troubling over.
	 */
	if (check_system_link_file("/etc/localtime", &tt, resultbuf))
		return resultbuf;

which is actually a behaviour changing, rather than just an
optimization, when there's a lot of equivalently scoring timezones.

Greetings,

Andres Freund



Commits

  1. Tweak our special-case logic for the IANA "Factory" timezone.

  2. Avoid choosing "localtime" or "posixrules" as TimeZone during initdb.

  3. Prefer timezone name "UTC" over alternative spellings.

  4. Attempt to identify system timezone by reading /etc/localtime symlink.

  5. Update time zone data files to tzdata release 2019a.