diff options
Diffstat (limited to 'src/backend/utils/adt/datetime.c')
-rw-r--r-- | src/backend/utils/adt/datetime.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/backend/utils/adt/datetime.c b/src/backend/utils/adt/datetime.c index 979f6fd7b22..7b585492200 100644 --- a/src/backend/utils/adt/datetime.c +++ b/src/backend/utils/adt/datetime.c @@ -4840,16 +4840,15 @@ pg_timezone_names(PG_FUNCTION_ARGS) 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. + * IANA's rather silly "Factory" time zone used to emit ridiculously + * long "abbreviations" such as "Local time zone must be set--see zic + * manual page" or "Local time zone must be set--use tzsetup". While + * modern versions of tzdb emit the much saner "-00", it seems some + * benighted packagers are hacking the IANA data so that it continues + * to produce these strings. To prevent producing a weirdly wide + * abbrev column, reject ridiculously long abbreviations. */ - if (tzn && (strcmp(tzn, "-00") == 0 || - strcmp(tzn, "Local time zone must be set--see zic manual page") == 0)) + if (tzn && strlen(tzn) > 31) continue; /* Found a displayable zone */ |