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

Code review for GUC revert-values-if-removed-from-postgresql.conf patch;

and in passing, fix some bogosities dating from the custom_variable_classes
patch.  Fix guc-file.l to correctly check changes in custom_variable_classes
that are attempted concurrently with additions/removals of custom variables,
and don't allow the new setting to be applied in advance of checking it.
Clean up messy and undocumented situation for string variables with NULL
boot_val.  Fix DefineCustomVariable functions to initialize boot_val
correctly.  Prevent find_option from inserting bogus placeholders for custom
variables that are simply inquired about rather than being set.
This commit is contained in:
Tom Lane
2007-09-10 00:57:22 +00:00
parent 43df609daa
commit 40fda15dce
5 changed files with 413 additions and 398 deletions

View File

@ -20,7 +20,7 @@
* Copyright (c) 2006-2007, PostgreSQL Global Development Group
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/cache/ts_cache.c,v 1.2 2007/08/22 01:39:45 tgl Exp $
* $PostgreSQL: pgsql/src/backend/utils/cache/ts_cache.c,v 1.3 2007/09/10 00:57:21 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -592,14 +592,6 @@ getTSCurrentConfig(bool emitError)
const char *
assignTSCurrentConfig(const char *newval, bool doit, GucSource source)
{
/* do nothing during initial GUC setup */
if (newval == NULL)
{
if (doit)
TSCurrentConfigCache = InvalidOid;
return newval;
}
/*
* If we aren't inside a transaction, we cannot do database access so
* cannot verify the config name. Must accept it on faith.
@ -637,7 +629,7 @@ assignTSCurrentConfig(const char *newval, bool doit, GucSource source)
newval = strdup(buf);
pfree(buf);
if (doit)
if (doit && newval)
TSCurrentConfigCache = cfgId;
}
else