Skip to content

Commit 9cfe353

Browse files
committed
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.
1 parent 5508d0c commit 9cfe353

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/backend/utils/adt/datetime.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4823,8 +4823,17 @@ pg_timezone_names(PG_FUNCTION_ARGS)
48234823
&tzoff, &tm, &fsec, &tzn, tz) != 0)
48244824
continue; /* ignore if conversion fails */
48254825

4826-
/* Ignore zic's rather silly "Factory" time zone */
4827-
if (tzn && strcmp(tzn, "Local time zone must be set--see zic manual page") == 0)
4826+
/*
4827+
* Ignore zic's rather silly "Factory" time zone. The long string
4828+
* about "see zic manual page" is used in tzdata versions before
4829+
* 2016g; we can drop it someday when we're pretty sure no such data
4830+
* exists in the wild on platforms using --with-system-tzdata. In
4831+
* 2016g and later, the time zone abbreviation "-00" is used for
4832+
* "Factory" as well as some invalid cases, all of which we can
4833+
* reasonably omit from the pg_timezone_names view.
4834+
*/
4835+
if (tzn && (strcmp(tzn, "-00") == 0 ||
4836+
strcmp(tzn, "Local time zone must be set--see zic manual page") == 0))
48284837
continue;
48294838

48304839
/* Found a displayable zone */

0 commit comments

Comments
 (0)