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 1hYvcM-0002vD-1z for pgsql-hackers@arkaria.postgresql.org; Thu, 06 Jun 2019 16:51:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hYvcI-0005P5-4b for pgsql-hackers@arkaria.postgresql.org; Thu, 06 Jun 2019 16:51:54 +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 1hYvcH-0005N4-S6 for pgsql-hackers@lists.postgresql.org; Thu, 06 Jun 2019 16:51:53 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hYvcE-00053D-Bj for pgsql-hackers@postgresql.org; Thu, 06 Jun 2019 16:51:52 +0000 Received: from pro.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x56GpUn8015555; Thu, 6 Jun 2019 12:51:31 -0400 From: Tom Lane To: Andres Freund cc: Andrew Gierth , Christoph Berg , PostgreSQL Hackers Subject: Re: UCT (Re: pgsql: Update time zone data files to tzdata release 2019a.) In-reply-to: <20190604164457.772invck3lgxk75s@alap3.anarazel.de> References: <20190604085735.GD24018@msg.df7cb.de> <87ftop8gtr.fsf@news-spur.riddles.org.uk> <20190604164457.772invck3lgxk75s@alap3.anarazel.de> Comments: In-reply-to Andres Freund message dated "Tue, 04 Jun 2019 16:44:57 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <5518.1559839890.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Thu, 06 Jun 2019 12:51:30 -0400 Message-ID: <5519.1559839890@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk [ sorry for slow response, I'm on vacation ] Andres Freund writes: > 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 th= e > * 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. Sure, that is intentionally a behavior change in this situation. The theory is that if "Etc/UCT" is what the user put in /etc/localtime, then that's the spelling she wants. See 23bd3cec6. But it seems to me that this code is *not* determining the result in Christoph's case, because if it were, it'd be settling on Etc/UTC, according to his followup report that >> lrwxrwxrwx 1 root root 27 M=C3=A4r 28 14:49 /etc/localtime -> /usr/shar= e/zoneinfo/Etc/UTC I'm not too familiar with what actually determines glibc's behavior on Debian, but I'm suspicious that there's an inconsistency between /etc/localtime and /etc/timezone. We won't adopt the spelling we see in /etc/localtime unless it agrees with the observed behavior of localtime(3). regards, tom lane