if (newval->intval < conf->min || newval->intval > conf->max)
{
const char *unit = get_config_unit_name(conf->gen.flags);
+ const char *unitspace;
+
+ if (unit)
+ unitspace = " ";
+ else
+ unit = unitspace = "";
ereport(elevel,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("%d%s%s is outside the valid range for parameter \"%s\" (%d .. %d)",
- newval->intval,
- unit ? " " : "",
- unit ? unit : "",
+ errmsg("%d%s%s is outside the valid range for parameter \"%s\" (%d%s%s .. %d%s%s)",
+ newval->intval, unitspace, unit,
name,
- conf->min, conf->max)));
+ conf->min, unitspace, unit,
+ conf->max, unitspace, unit)));
return false;
}
if (newval->realval < conf->min || newval->realval > conf->max)
{
const char *unit = get_config_unit_name(conf->gen.flags);
+ const char *unitspace;
+
+ if (unit)
+ unitspace = " ";
+ else
+ unit = unitspace = "";
ereport(elevel,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("%g%s%s is outside the valid range for parameter \"%s\" (%g .. %g)",
- newval->realval,
- unit ? " " : "",
- unit ? unit : "",
+ errmsg("%g%s%s is outside the valid range for parameter \"%s\" (%g%s%s .. %g%s%s)",
+ newval->realval, unitspace, unit,
name,
- conf->min, conf->max)));
+ conf->min, unitspace, unit,
+ conf->max, unitspace, unit)));
return false;
}
SET seq_page_cost TO 'NaN';
ERROR: invalid value for parameter "seq_page_cost": "NaN"
SET vacuum_cost_delay TO '10s';
-ERROR: 10000 ms is outside the valid range for parameter "vacuum_cost_delay" (0 .. 100)
+ERROR: 10000 ms is outside the valid range for parameter "vacuum_cost_delay" (0 ms .. 100 ms)
SET no_such_variable TO 42;
ERROR: unrecognized configuration parameter "no_such_variable"
-- Test "custom" GUCs created on the fly (which aren't really an