* Written by Peter Eisentraut <peter_e@gmx.net>.
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.198 2004/04/07 05:05:50 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.199 2004/04/07 18:52:26 momjian Exp $
*
*--------------------------------------------------------------------
*/
name)));
return false;
}
- if (record->context == PGC_USERLIMIT &&
- IsUnderPostmaster && !superuser())
+ if (record->context == PGC_USERLIMIT)
{
if (newval < conf->reset_val)
{
/* Limit non-superuser changes */
- if (source > PGC_S_UNPRIVILEGED)
+ if (source > PGC_S_UNPRIVILEGED && !superuser())
{
ereport(elevel,
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
{
/* Allow change if admin should override */
if (source < PGC_S_UNPRIVILEGED &&
- record->source > PGC_S_UNPRIVILEGED)
+ record->source > PGC_S_UNPRIVILEGED &&
+ !superuser())
changeVal = changeValOrig;
}
}
newval, name, conf->min, conf->max)));
return false;
}
- if (record->context == PGC_USERLIMIT &&
- IsUnderPostmaster && !superuser())
+ if (record->context == PGC_USERLIMIT)
{
/* handle log_min_duration_statement, -1=disable */
if ((newval != -1 && conf->reset_val != -1 &&
(newval == -1 && conf->reset_val != -1)) /* turn off */
{
/* Limit non-superuser changes */
- if (source > PGC_S_UNPRIVILEGED)
+ if (source > PGC_S_UNPRIVILEGED && !superuser())
{
ereport(elevel,
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
(newval != -1 && *conf->variable == -1)) /* turn on */
{
if (source < PGC_S_UNPRIVILEGED &&
- record->source > PGC_S_UNPRIVILEGED)
+ record->source > PGC_S_UNPRIVILEGED &&
+ !superuser())
changeVal = changeValOrig;
}
}
newval, name, conf->min, conf->max)));
return false;
}
- if (record->context == PGC_USERLIMIT &&
- IsUnderPostmaster && !superuser())
+ if (record->context == PGC_USERLIMIT)
/* No REAL PGC_USERLIMIT */
{
/* Limit non-superuser changes */
- if (source > PGC_S_UNPRIVILEGED)
+ if (source > PGC_S_UNPRIVILEGED && !superuser())
{
ereport(elevel,
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
}
/* Allow change if admin should override */
if (source < PGC_S_UNPRIVILEGED &&
- record->source > PGC_S_UNPRIVILEGED)
+ record->source > PGC_S_UNPRIVILEGED &&
+ !superuser())
changeVal = false;
}
}
return false;
}
- if (record->context == PGC_USERLIMIT &&
- IsUnderPostmaster && !superuser())
+ if (record->context == PGC_USERLIMIT)
{
int var_value, reset_value, new_value;
const char * (*var_hook) (int *var, const char *newval,
if (new_value > reset_value)
{
/* Limit non-superuser changes */
- if (source > PGC_S_UNPRIVILEGED)
+ if (source > PGC_S_UNPRIVILEGED && !superuser())
{
ereport(elevel,
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
if (new_value < var_value)
{
if (source < PGC_S_UNPRIVILEGED &&
- record->source > PGC_S_UNPRIVILEGED)
+ record->source > PGC_S_UNPRIVILEGED &&
+ !superuser())
changeVal = changeValOrig;
}
}