From 54d60bbd075a61c7dd2ef384dc930d726d68ee64 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sat, 3 Oct 2009 18:04:57 +0000 Subject: Fix a couple of issues in recent patch to print updates to postgresql.conf settings: avoid calling superuser() in contexts where it's not defined, don't leak the transient copies of GetConfigOption output, and avoid the whole exercise in postmaster child processes. I found that actually no current caller of GetConfigOption has any use for its internal check of GUC_SUPERUSER_ONLY. But rather than just remove that entirely, it seemed better to add a parameter indicating whether to enforce the check. Per report from Simon and subsequent testing. --- src/timezone/pgtz.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/timezone/pgtz.c') diff --git a/src/timezone/pgtz.c b/src/timezone/pgtz.c index 82a02438780..ea26bbd3d39 100644 --- a/src/timezone/pgtz.c +++ b/src/timezone/pgtz.c @@ -6,7 +6,7 @@ * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group * * IDENTIFICATION - * $PostgreSQL: pgsql/src/timezone/pgtz.c,v 1.63 2009/06/11 14:49:15 momjian Exp $ + * $PostgreSQL: pgsql/src/timezone/pgtz.c,v 1.64 2009/10/03 18:04:57 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -1366,7 +1366,7 @@ pg_timezone_initialize(void) pg_tz *def_tz = NULL; /* Do we need to try to figure the session timezone? */ - if (pg_strcasecmp(GetConfigOption("timezone"), "UNKNOWN") == 0) + if (pg_strcasecmp(GetConfigOption("timezone", false), "UNKNOWN") == 0) { /* Select setting */ def_tz = select_default_timezone(); @@ -1377,7 +1377,7 @@ pg_timezone_initialize(void) } /* What about the log timezone? */ - if (pg_strcasecmp(GetConfigOption("log_timezone"), "UNKNOWN") == 0) + if (pg_strcasecmp(GetConfigOption("log_timezone", false), "UNKNOWN") == 0) { /* Select setting, but don't duplicate work */ if (!def_tz) -- cgit v1.2.3