pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andrew Gierth <andrew@tao11.riddles.org.uk>
Cc: Thomas Munro <thomas.munro@gmail.com>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Stephen Frost <sfrost@snowman.net>
Cc: Andres Freund <andres@anarazel.de>
Cc: Christoph Berg <myon@debian.org>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Subject: Re: UCT (Re: pgsql: Update time zone data files to tzdata release 2019a.)
Date: Wed, 26 Jun 2019 13:59:58 -0400
Message-ID: <5121.1561571998@sss.pgh.pa.us> (raw)
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>
	<CA+TgmoYF00U3Pbkh4mXhXr1NN6pKFM278KmXRS35HDuHgNcMFw@mail.gmail.com>
	<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>
	<CA+hUKGLZN3XHqZPN08itV4W-Nu3ndZ9zKJGSvzoWLm6AU9vz-g@mail.gmail.com>
	<8736jwsdv2.fsf@news-spur.riddles.org.uk>
	<17148.1561568815@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

Attachments:

drop-factory-zone-discrimination.patch (text/x-diff, 1.5K) download diff --git a/src/backend/utils/adt/datetime.c b/src/backend/utils/adt/datetime.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) != 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") == 0 || - strcmp(tzn, "Local time zone must be set--see zic manual page") == 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") == 0) - return NULL; return resultbuf; - } /* * Couldn't find a match in the database, so next we try constructed zone

view thread (74+ messages)  latest in thread

Message-ID: <5121.1561571998@sss.pgh.pa.us>
Permalink:  ../5121.1561571998@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/5121.1561571998@sss.pgh.pa.us

 ·  · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, andrew@tao11.riddles.org.uk, thomas.munro@gmail.com, robertmhaas@gmail.com, sfrost@snowman.net, andres@anarazel.de, myon@debian.org, pgsql-hackers@postgresql.org
  Subject: Re: UCT (Re: pgsql: Update time zone data files to tzdata release 2019a.)
  In-Reply-To: <5121.1561571998@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox