@@ -3173,15 +3173,20 @@ parse_and_validate_value(struct config_generic *record,
3173
3173
if (newval -> intval < conf -> min || newval -> intval > conf -> max )
3174
3174
{
3175
3175
const char * unit = get_config_unit_name (conf -> gen .flags );
3176
+ const char * unitspace ;
3177
+
3178
+ if (unit )
3179
+ unitspace = " " ;
3180
+ else
3181
+ unit = unitspace = "" ;
3176
3182
3177
3183
ereport (elevel ,
3178
3184
(errcode (ERRCODE_INVALID_PARAMETER_VALUE ),
3179
- errmsg ("%d%s%s is outside the valid range for parameter \"%s\" (%d .. %d)" ,
3180
- newval -> intval ,
3181
- unit ? " " : "" ,
3182
- unit ? unit : "" ,
3185
+ errmsg ("%d%s%s is outside the valid range for parameter \"%s\" (%d%s%s .. %d%s%s)" ,
3186
+ newval -> intval , unitspace , unit ,
3183
3187
name ,
3184
- conf -> min , conf -> max )));
3188
+ conf -> min , unitspace , unit ,
3189
+ conf -> max , unitspace , unit )));
3185
3190
return false;
3186
3191
}
3187
3192
@@ -3209,15 +3214,20 @@ parse_and_validate_value(struct config_generic *record,
3209
3214
if (newval -> realval < conf -> min || newval -> realval > conf -> max )
3210
3215
{
3211
3216
const char * unit = get_config_unit_name (conf -> gen .flags );
3217
+ const char * unitspace ;
3218
+
3219
+ if (unit )
3220
+ unitspace = " " ;
3221
+ else
3222
+ unit = unitspace = "" ;
3212
3223
3213
3224
ereport (elevel ,
3214
3225
(errcode (ERRCODE_INVALID_PARAMETER_VALUE ),
3215
- errmsg ("%g%s%s is outside the valid range for parameter \"%s\" (%g .. %g)" ,
3216
- newval -> realval ,
3217
- unit ? " " : "" ,
3218
- unit ? unit : "" ,
3226
+ errmsg ("%g%s%s is outside the valid range for parameter \"%s\" (%g%s%s .. %g%s%s)" ,
3227
+ newval -> realval , unitspace , unit ,
3219
3228
name ,
3220
- conf -> min , conf -> max )));
3229
+ conf -> min , unitspace , unit ,
3230
+ conf -> max , unitspace , unit )));
3221
3231
return false;
3222
3232
}
3223
3233
0 commit comments