From 312d51798ffb7060b672e1f3b0039639eefffdb4 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Thu, 13 Nov 2008 20:49:38 +0000 Subject: [PATCH] Suppress leap-second-aware timezones in the output of pg_tzenumerate_next, and thereby in the pg_timezone_names view. Although we allow such zones to be used in certain limited contexts like AT TIME ZONE, we don't allow them in SET TIME ZONE, and bug #4528 shows that they're more likely to confuse users than do anything useful. So hide 'em. (Note that we don't even generate these zones when installing our own timezone database. But they are likely to be present when using a system-provided database.) --- src/timezone/pgtz.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/timezone/pgtz.c b/src/timezone/pgtz.c index bdd22506672..0e23c189b37 100644 --- a/src/timezone/pgtz.c +++ b/src/timezone/pgtz.c @@ -6,7 +6,7 @@ * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group * * IDENTIFICATION - * $PostgreSQL: pgsql/src/timezone/pgtz.c,v 1.60 2008/07/01 03:40:55 tgl Exp $ + * $PostgreSQL: pgsql/src/timezone/pgtz.c,v 1.61 2008/11/13 20:49:38 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -1499,6 +1499,12 @@ pg_tzenumerate_next(pg_tzenum *dir) continue; } + if (!tz_acceptable(&dir->tz)) + { + /* Ignore leap-second zones */ + continue; + } + /* Timezone loaded OK. */ return &dir->tz; }