diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2009-10-03 18:04:57 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2009-10-03 18:04:57 +0000 |
commit | 54d60bbd075a61c7dd2ef384dc930d726d68ee64 (patch) | |
tree | e42859f4f1d4da1b83497ce59fd2b4713abc0035 /src/timezone/pgtz.c | |
parent | 66a8417f4e595fe72bf610f58fa013823f00cb47 (diff) | |
download | postgresql-54d60bbd075a61c7dd2ef384dc930d726d68ee64.tar.gz postgresql-54d60bbd075a61c7dd2ef384dc930d726d68ee64.zip |
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.
Diffstat (limited to 'src/timezone/pgtz.c')
-rw-r--r-- | src/timezone/pgtz.c | 6 |
1 files changed, 3 insertions, 3 deletions
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) |