Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hY6YK-0005dH-Lv for pgsql-hackers@arkaria.postgresql.org; Tue, 04 Jun 2019 10:20:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hY6YI-0008Fc-EN for pgsql-hackers@arkaria.postgresql.org; Tue, 04 Jun 2019 10:20:22 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hY6YI-0008AX-3J for pgsql-hackers@lists.postgresql.org; Tue, 04 Jun 2019 10:20:22 +0000 Received: from lungold.riddles.org.uk ([82.68.208.19]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hY6YF-0005mR-G9 for pgsql-hackers@postgresql.org; Tue, 04 Jun 2019 10:20:21 +0000 Received: from [192.168.127.1] (port=19538 helo=caithnard.riddles.org.uk) by lungold.riddles.org.uk with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.88 (FreeBSD)) (envelope-from ) id 1hY6YB-00040X-C9; Tue, 04 Jun 2019 10:20:15 +0000 Received: from [127.0.0.1] (port=36419 helo=caithnard.riddles.org.uk) by caithnard.riddles.org.uk with esmtp (Exim 4.89 (FreeBSD)) (envelope-from ) id 1hY6YA-0001qb-NU; Tue, 04 Jun 2019 10:20:14 +0000 From: Andrew Gierth To: Christoph Berg Cc: Tom Lane , PostgreSQL Hackers Subject: Re: UCT (Re: pgsql: Update time zone data files to tzdata release 2019a.) In-Reply-To: <20190604085735.GD24018@msg.df7cb.de> (Christoph Berg's message of "Tue, 4 Jun 2019 10:57:35 +0200") Message-ID: <87blzdacpp.fsf@news-spur.riddles.org.uk> References: <20190604085735.GD24018@msg.df7cb.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (berkeley-unix) Date: Tue, 04 Jun 2019 11:20:14 +0100 MIME-Version: 1.0 Content-Type: text/plain List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk >>>>> "Christoph" == Christoph Berg writes: >> Etc/UCT is now a backward-compatibility link to Etc/UTC, instead of >> being a separate zone that generates the abbreviation "UCT", which >> nowadays is typically a typo. Postgres will still accept "UCT" as an >> input zone name, but it won't output it. Christoph> There is something wrong here. On Debian Buster/unstable, Christoph> using system tzdata (2019a-1), if /etc/timezone is Christoph> "Etc/UTC": Christoph> 11.3's initdb adds timezone = 'UCT' to postgresql.conf Christoph> 12beta1's initdb add timezone = 'Etc/UCT' to postgresql.conf Christoph> Is that expected behavior? It's clearly not what users expect and it's clearly the wrong thing to do, though it's the expected behavior of the current code: * On most systems, we rely on trying to match the observable behavior of * the C library's localtime() function. The database zone that matches * furthest into the past is the one to use. Often there will be several * zones with identical rankings (since the IANA database assigns multiple * names to many zones). We break ties arbitrarily by preferring shorter, * then alphabetically earlier zone names. I believe I pointed out a long, long time ago that this tie-breaking strategy was insane, and that the rule should be to prefer canonical names and use something else only in the case of a strictly better match. If TZ is set or if /etc/localtime is a symlink rather than a hardlink or copy of the zone file, then PG can get the zone name directly rather than having to do the comparisons, so the above comment doesn't apply; that gives you a workaround. -- Andrew (irc:RhodiumToad)