* Written by Peter Eisentraut <peter_e@gmx.net>.
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/misc/guc.c,v 1.151 2003/08/26 15:38:25 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/misc/guc.c,v 1.152 2003/09/01 04:15:50 momjian Exp $
*
*--------------------------------------------------------------------
*/
* properly.
*
* If value is NULL, set the option to its default value. If the
- * parameter DoIt is false then don't really set the option but do all
+ * parameter changeVal is false then don't really set the option but do all
* the checks to see if it would work.
*
* If there is an error (non-existing option, invalid value) then an
bool
set_config_option(const char *name, const char *value,
GucContext context, GucSource source,
- bool isLocal, bool DoIt)
+ bool isLocal, bool changeVal)
{
struct config_generic *record;
int elevel;
bool interactive;
bool makeDefault;
- bool DoIt_orig;
+ bool changeVal_orig;
if (context == PGC_SIGHUP || source == PGC_S_DEFAULT)
elevel = DEBUG2;
* Should we set reset/session values? (If so, the behavior is not
* transactional.)
*/
- makeDefault = DoIt && (source <= PGC_S_OVERRIDE) && (value != NULL);
+ makeDefault = changeVal && (source <= PGC_S_OVERRIDE) && (value != NULL);
/*
* Ignore attempted set if overridden by previously processed setting.
- * However, if DoIt is false then plow ahead anyway since we are
+ * However, if changeVal is false then plow ahead anyway since we are
* trying to find out if the value is potentially good, not actually
* use it. Also keep going if makeDefault is true, since we may want
* to set the reset/session values even if we can't set the variable
* itself.
*/
- DoIt_orig = DoIt; /* we might have to reverse this later */
+ changeVal_orig = changeVal; /* we might have to reverse this later */
if (record->source > source)
{
- if (DoIt && !makeDefault)
+ if (changeVal && !makeDefault)
{
elog(DEBUG3, "\"%s\": setting ignored because previous source is higher priority",
name);
return true;
}
- DoIt = false; /* we won't change the variable itself */
+ changeVal = false; /* we won't change the variable itself */
}
/*
record->session_source > PGC_S_UNPRIVILEGED &&
newval > conf->session_val &&
!superuser())
- DoIt = DoIt_orig;
+ changeVal = changeVal_orig;
}
else
{
}
if (conf->assign_hook)
- if (!(*conf->assign_hook) (newval, DoIt, interactive))
+ if (!(*conf->assign_hook) (newval, changeVal, interactive))
{
ereport(elevel,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
return false;
}
- if (DoIt || makeDefault)
+ if (changeVal || makeDefault)
{
- if (DoIt)
+ if (changeVal)
{
*conf->variable = newval;
conf->gen.source = source;
record->session_source > PGC_S_UNPRIVILEGED &&
newval < conf->session_val &&
!superuser())
- DoIt = DoIt_orig;
+ changeVal = changeVal_orig;
}
else
{
}
if (conf->assign_hook)
- if (!(*conf->assign_hook) (newval, DoIt, interactive))
+ if (!(*conf->assign_hook) (newval, changeVal, interactive))
{
ereport(elevel,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
return false;
}
- if (DoIt || makeDefault)
+ if (changeVal || makeDefault)
{
- if (DoIt)
+ if (changeVal)
{
*conf->variable = newval;
conf->gen.source = source;
record->session_source > PGC_S_UNPRIVILEGED &&
newval < conf->session_val &&
!superuser())
- DoIt = DoIt_orig;
+ changeVal = changeVal_orig;
}
else
{
}
if (conf->assign_hook)
- if (!(*conf->assign_hook) (newval, DoIt, interactive))
+ if (!(*conf->assign_hook) (newval, changeVal, interactive))
{
ereport(elevel,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
return false;
}
- if (DoIt || makeDefault)
+ if (changeVal || makeDefault)
{
- if (DoIt)
+ if (changeVal)
{
*conf->variable = newval;
conf->gen.source = source;
record->session_source > PGC_S_UNPRIVILEGED &&
newval < conf->session_val &&
!superuser())
- DoIt = DoIt_orig;
+ changeVal = changeVal_orig;
}
}
else if (conf->reset_val)
const char *hookresult;
hookresult = (*conf->assign_hook) (newval,
- DoIt, interactive);
+ changeVal, interactive);
guc_string_workspace = NULL;
if (hookresult == NULL)
{
guc_string_workspace = NULL;
- if (DoIt || makeDefault)
+ if (changeVal || makeDefault)
{
- if (DoIt)
+ if (changeVal)
{
SET_STRING_VARIABLE(conf, newval);
conf->gen.source = source;
}
}
- if (DoIt && (record->flags & GUC_REPORT))
+ if (changeVal && (record->flags & GUC_REPORT))
ReportGUCOption(record);
return true;
* Copyright (c) 2000-2003, PostgreSQL Global Development Group
* Written by Peter Eisentraut <peter_e@gmx.net>.
*
- * $Id: guc.h,v 1.40 2003/08/04 23:59:41 tgl Exp $
+ * $Id: guc.h,v 1.41 2003/09/01 04:15:51 momjian Exp $
*--------------------------------------------------------------------
*/
#ifndef GUC_H
extern void ParseLongOption(const char *string, char **name, char **value);
extern bool set_config_option(const char *name, const char *value,
GucContext context, GucSource source,
- bool isLocal, bool DoIt);
+ bool isLocal, bool changeVal);
extern void ShowGUCConfigOption(const char *name, DestReceiver *dest);
extern void ShowAllGUCConfig(DestReceiver *dest);
extern char *GetConfigOptionByName(const char *name, const char **varname);