1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-05 07:21:24 +03:00

Fix another oversight in logging of changes in postgresql.conf settings.

We were using GetConfigOption to collect the old value of each setting,
overlooking the possibility that it didn't exist yet.  This does happen
in the case of adding a new entry within a custom variable class, as
exhibited in bug #6097 from Maxim Boguk.

To fix, add a missing_ok parameter to GetConfigOption, but only in 9.1
and HEAD --- it seems possible that some third-party code is using that
function, so changing its API in a minor release would cause problems.
In 9.0, create a near-duplicate function instead.
This commit is contained in:
Tom Lane
2011-07-08 17:02:58 -04:00
parent 89fd72cbf2
commit 9d522cb35d
4 changed files with 20 additions and 11 deletions

View File

@ -814,14 +814,14 @@ execute_extension_script(Oid extensionOid, ExtensionControlFile *control,
* error.
*/
save_client_min_messages =
pstrdup(GetConfigOption("client_min_messages", false));
pstrdup(GetConfigOption("client_min_messages", false, false));
if (client_min_messages < WARNING)
(void) set_config_option("client_min_messages", "warning",
PGC_USERSET, PGC_S_SESSION,
GUC_ACTION_LOCAL, true);
save_log_min_messages =
pstrdup(GetConfigOption("log_min_messages", false));
pstrdup(GetConfigOption("log_min_messages", false, false));
if (log_min_messages < WARNING)
(void) set_config_option("log_min_messages", "warning",
PGC_SUSET, PGC_S_SESSION,
@ -836,7 +836,7 @@ execute_extension_script(Oid extensionOid, ExtensionControlFile *control,
* but we cannot do that. We have to actually set the search_path GUC in
* case the extension script examines or changes it.
*/
save_search_path = pstrdup(GetConfigOption("search_path", false));
save_search_path = pstrdup(GetConfigOption("search_path", false, false));
initStringInfo(&pathbuf);
appendStringInfoString(&pathbuf, quote_identifier(schemaName));