From: Tom Lane Date: Thu, 13 Nov 2008 20:49:38 +0000 (+0000) Subject: Suppress leap-second-aware timezones in the output of pg_tzenumerate_next, X-Git-Tag: recoveryinfrav9~359 X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=13f5c64bf1826379357127f18bf1e8b94d49cc55;p=users%2Fsimon%2Fpostgres.git 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.) --- diff --git a/src/timezone/pgtz.c b/src/timezone/pgtz.c index 98f2615ee2..8e0645f705 100644 --- a/src/timezone/pgtz.c +++ b/src/timezone/pgtz.c @@ -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; }