Skip to content

Commit bca6d83

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 22cf976 commit bca6d83

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
@@ -4763,8 +4763,17 @@ pg_timezone_names(PG_FUNCTION_ARGS)
47634763
&tzoff, &tm, &fsec, &tzn, tz) != 0)
47644764
continue; /* ignore if conversion fails */
47654765

4766-
/* Ignore zic's rather silly "Factory" time zone */
4767-
if (tzn && strcmp(tzn, "Local time zone must be set--see zic manual page") == 0)
4766+
/*
4767+
* Ignore zic's rather silly "Factory" time zone. The long string
4768+
* about "see zic manual page" is used in tzdata versions before
4769+
* 2016g; we can drop it someday when we're pretty sure no such data
4770+
* exists in the wild on platforms using --with-system-tzdata. In
4771+
* 2016g and later, the time zone abbreviation "-00" is used for
4772+
* "Factory" as well as some invalid cases, all of which we can
4773+
* reasonably omit from the pg_timezone_names view.
4774+
*/
4775+
if (tzn && (strcmp(tzn, "-00") == 0 ||
4776+
strcmp(tzn, "Local time zone must be set--see zic manual page") == 0))
47684777
continue;
47694778

47704779
/* Found a displayable zone */

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy