summaryrefslogtreecommitdiff
path: root/src/timezone/pgtz.c
diff options
context:
space:
mode:
authorTom Lane2008-11-13 20:49:38 +0000
committerTom Lane2008-11-13 20:49:38 +0000
commit312d51798ffb7060b672e1f3b0039639eefffdb4 (patch)
tree5489f189394596e1261f96ee0f2e33ad59439949 /src/timezone/pgtz.c
parent10e3acb8e7bd3298ba2b942f86c18f5ba2e142a8 (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.)
Diffstat (limited to 'src/timezone/pgtz.c')
-rw-r--r--src/timezone/pgtz.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/timezone/pgtz.c b/src/timezone/pgtz.c
index bdd2250667..0e23c189b3 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;
}