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 1hgCDP-0006vi-2k for pgsql-hackers@arkaria.postgresql.org; Wed, 26 Jun 2019 18:00:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hgCDM-0006Uf-7M for pgsql-hackers@arkaria.postgresql.org; Wed, 26 Jun 2019 18:00:12 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hgCDL-0006UX-MA for pgsql-hackers@lists.postgresql.org; Wed, 26 Jun 2019 18:00:11 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hgCDH-0003z2-Vy for pgsql-hackers@postgresql.org; Wed, 26 Jun 2019 18:00:09 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x5QHxw0d005122; Wed, 26 Jun 2019 13:59:58 -0400 From: Tom Lane To: Andrew Gierth cc: Thomas Munro , Robert Haas , Stephen Frost , Andres Freund , Christoph Berg , PostgreSQL Hackers Subject: Re: UCT (Re: pgsql: Update time zone data files to tzdata release 2019a.) In-reply-to: <17148.1561568815@sss.pgh.pa.us> References: <24452.1560285699@sss.pgh.pa.us> <20190614095546.GA15107@msg.df7cb.de> <26948.1560517875@sss.pgh.pa.us> <87ef3w3u8a.fsf@news-spur.riddles.org.uk> <7114.1560539536@sss.pgh.pa.us> <875zp74zpf.fsf@news-spur.riddles.org.uk> <871rzv4yes.fsf@news-spur.riddles.org.uk> <20190617173943.z3ttxqenbcwrlag4@alap3.anarazel.de> <20190617183458.GG2480@tamriel.snowman.net> <20190617183828.hj7ci362zbxd4nax@alap3.anarazel.de> <20190617184053.GI2480@tamriel.snowman.net> <25314.1560980148@sss.pgh.pa.us> <27991.1560984458@sss.pgh.pa.us> <877e9h18df.fsf@news-spur.riddles.org.uk> <2643.1561508327@sss.pgh.pa.us> <877e98syi5.fsf@news-spur.riddles.org.uk> <8736jwsdv2.fsf@news-spur.riddles.org.uk> <17148.1561568815@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Wed, 26 Jun 2019 13:06:55 -0400" MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----- =_aaaaaaaaaa0" Content-ID: <5071.1561571919.0@sss.pgh.pa.us> Date: Wed, 26 Jun 2019 13:59:58 -0400 Message-ID: <5121.1561571998@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk ------- =_aaaaaaaaaa0 Content-Type: text/plain; charset="us-ascii" Content-ID: <5071.1561571919.1@sss.pgh.pa.us> Further on this --- I now remember that the reason we used to want to reject the "Factory" timezone is that it used to report this as the zone abbreviation: Local time zone must be set--see zic manual page which (a) resulted in syntactically invalid timestamp output from the timeofday() function and (b) completely screwed up the column width in the pg_timezone_names view. But since 2016g, it's reported the much-less-insane string "-00". I propose therefore that it's time to just drop the discrimination against "Factory", as per attached. There doesn't seem to be any reason anymore to forbid people from seeing it in pg_timezone_names or selecting it as the timezone if they're so inclined. We would only have a problem if somebody is using --with-system-tzdata in a machine where they've not updated the system tzdata since 2016, and I'm no longer willing to consider that a valid use-case. regards, tom lane ------- =_aaaaaaaaaa0 Content-Type: text/x-diff; name="drop-factory-zone-discrimination.patch"; charset="us-ascii" Content-ID: <5071.1561571919.2@sss.pgh.pa.us> Content-Description: drop-factory-zone-discrimination.patch Content-Transfer-Encoding: quoted-printable diff --git a/src/backend/utils/adt/datetime.c b/src/backend/utils/adt/date= time.c index 9def318..91b1847 100644 --- a/src/backend/utils/adt/datetime.c +++ b/src/backend/utils/adt/datetime.c @@ -4845,19 +4845,6 @@ pg_timezone_names(PG_FUNCTION_ARGS) &tzoff, &tm, &fsec, &tzn, tz) !=3D 0) continue; /* ignore if conversion fails */ = - /* - * Ignore zic's rather silly "Factory" time zone. The long string - * about "see zic manual page" is used in tzdata versions before - * 2016g; we can drop it someday when we're pretty sure no such data - * exists in the wild on platforms using --with-system-tzdata. In - * 2016g and later, the time zone abbreviation "-00" is used for - * "Factory" as well as some invalid cases, all of which we can - * reasonably omit from the pg_timezone_names view. - */ - if (tzn && (strcmp(tzn, "-00") =3D=3D 0 || - strcmp(tzn, "Local time zone must be set--see zic manual page") =3D=3D= 0)) - continue; - /* Found a displayable zone */ break; } diff --git a/src/bin/initdb/findtimezone.c b/src/bin/initdb/findtimezone.c index f91fd31..fc86ff0 100644 --- a/src/bin/initdb/findtimezone.c +++ b/src/bin/initdb/findtimezone.c @@ -413,12 +413,7 @@ identify_system_timezone(void) &tt, &bestscore, resultbuf); if (bestscore > 0) - { - /* Ignore IANA's rather silly "Factory" zone; use GMT instead */ - if (strcmp(resultbuf, "Factory") =3D=3D 0) - return NULL; return resultbuf; - } = /* * Couldn't find a match in the database, so next we try constructed zon= e ------- =_aaaaaaaaaa0--