aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/datetime.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2016-10-19 18:11:49 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2016-10-19 18:11:49 -0400
commita3215431ab7c667bf581728f10c80a36abbe1d5a (patch)
treeda41736cb7351c3b238527f79f274805120e56c2 /src/backend/utils/adt/datetime.c
parentecbac3e6e038e990f24a2e0eacdcd6738292105f (diff)
downloadpostgresql-a3215431ab7c667bf581728f10c80a36abbe1d5a.tar.gz
postgresql-a3215431ab7c667bf581728f10c80a36abbe1d5a.zip
Suppress "Factory" zone in pg_timezone_names view for tzdata >= 2016g.
IANA got rid of the really silly "abbreviation" and replaced it with one that's only moderately silly. But it's still pointless, so keep on not showing it.
Diffstat (limited to 'src/backend/utils/adt/datetime.c')
-rw-r--r--src/backend/utils/adt/datetime.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/backend/utils/adt/datetime.c b/src/backend/utils/adt/datetime.c
index 45ba7cd9063..6d7fdc3c5e4 100644
--- a/src/backend/utils/adt/datetime.c
+++ b/src/backend/utils/adt/datetime.c
@@ -4957,8 +4957,17 @@ 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 */
- if (tzn && strcmp(tzn, "Local time zone must be set--see zic manual page") == 0)
+ /*
+ * 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 */