1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-23 14:01:44 +03:00

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.
This commit is contained in:
Tom Lane
2009-10-03 18:04:57 +00:00
parent 66a8417f4e
commit 54d60bbd07
4 changed files with 26 additions and 15 deletions

View File

@ -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)