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

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: UCT (Re: pgsql: Update time zone data files to tzdata release 2019a.)
Дата
Msg-id 5121.1561571998@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: UCT (Re: pgsql: Update time zone data files to tzdata release 2019a.)  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
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

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

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: UCT (Re: pgsql: Update time zone data files to tzdata release 2019a.)
Следующее
От: Pavel Stehule
Дата:
Сообщение: Re: dropdb --force