summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane2008-11-13 20:49:38 +0000
committerTom Lane2008-11-13 20:49:38 +0000
commit13f5c64bf1826379357127f18bf1e8b94d49cc55 (patch)
treeb04ec6c74fb349b4603338b8215424ce9aa5ef27
parentf7d4fb4e662f73a5a5af6fcf76e8494086814805 (diff)
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.)
-rw-r--r--src/timezone/pgtz.c6
1 files changed, 6 insertions, 0 deletions
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;
}