Skip to content

Commit 4e89c79

Browse files
committed
Remove excess parens in ereport() calls
Cosmetic cleanup, not worth backpatching. Discussion: https://postgr.es/m/[email protected] Reviewed-by: Tom Lane, Michael Paquier
1 parent 2520cf8 commit 4e89c79

37 files changed

+97
-97
lines changed

contrib/adminpack/adminpack.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ convert_and_check_filename(text *arg, bool logAllowed)
9393
if (path_contains_parent_reference(filename))
9494
ereport(ERROR,
9595
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
96-
(errmsg("reference to parent directory (\"..\") not allowed"))));
96+
errmsg("reference to parent directory (\"..\") not allowed")));
9797

9898
/*
9999
* Allow absolute paths if within DataDir or Log_directory, even
@@ -104,12 +104,12 @@ convert_and_check_filename(text *arg, bool logAllowed)
104104
!path_is_prefix_of_path(Log_directory, filename)))
105105
ereport(ERROR,
106106
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
107-
(errmsg("absolute path not allowed"))));
107+
errmsg("absolute path not allowed")));
108108
}
109109
else if (!path_is_relative_and_below_cwd(filename))
110110
ereport(ERROR,
111111
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
112-
(errmsg("path must be in or below the current directory"))));
112+
errmsg("path must be in or below the current directory")));
113113

114114
return filename;
115115
}
@@ -124,7 +124,7 @@ requireSuperuser(void)
124124
if (!superuser())
125125
ereport(ERROR,
126126
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
127-
(errmsg("only superuser may access generic file functions"))));
127+
errmsg("only superuser may access generic file functions")));
128128
}
129129

130130

@@ -485,7 +485,7 @@ pg_logdir_ls(PG_FUNCTION_ARGS)
485485
if (!superuser())
486486
ereport(ERROR,
487487
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
488-
(errmsg("only superuser can list the log directory"))));
488+
errmsg("only superuser can list the log directory")));
489489

490490
return (pg_logdir_ls_internal(fcinfo));
491491
}
@@ -515,7 +515,7 @@ pg_logdir_ls_internal(FunctionCallInfo fcinfo)
515515
if (strcmp(Log_filename, "postgresql-%Y-%m-%d_%H%M%S.log") != 0)
516516
ereport(ERROR,
517517
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
518-
(errmsg("the log_filename parameter must equal 'postgresql-%%Y-%%m-%%d_%%H%%M%%S.log'"))));
518+
errmsg("the log_filename parameter must equal 'postgresql-%%Y-%%m-%%d_%%H%%M%%S.log'")));
519519

520520
if (SRF_IS_FIRSTCALL())
521521
{

contrib/hstore_plperl/hstore_plperl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ plperl_to_hstore(PG_FUNCTION_ARGS)
116116
if (SvTYPE(in) != SVt_PVHV)
117117
ereport(ERROR,
118118
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
119-
(errmsg("cannot transform non-hash Perl value to hstore"))));
119+
errmsg("cannot transform non-hash Perl value to hstore")));
120120
hv = (HV *) in;
121121

122122
pcount = hv_iterinit(hv);

contrib/jsonb_plperl/jsonb_plperl.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,11 +235,11 @@ SV_to_JsonbValue(SV *in, JsonbParseState **jsonb_state, bool is_elem)
235235
if (isinf(nval))
236236
ereport(ERROR,
237237
(errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
238-
(errmsg("cannot convert infinity to jsonb"))));
238+
errmsg("cannot convert infinity to jsonb")));
239239
if (isnan(nval))
240240
ereport(ERROR,
241241
(errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
242-
(errmsg("cannot convert NaN to jsonb"))));
242+
errmsg("cannot convert NaN to jsonb")));
243243

244244
out.type = jbvNumeric;
245245
out.val.numeric =
@@ -260,7 +260,7 @@ SV_to_JsonbValue(SV *in, JsonbParseState **jsonb_state, bool is_elem)
260260
*/
261261
ereport(ERROR,
262262
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
263-
(errmsg("cannot transform this Perl type to jsonb"))));
263+
errmsg("cannot transform this Perl type to jsonb")));
264264
return NULL;
265265
}
266266
}

contrib/jsonb_plpython/jsonb_plpython.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ PLyNumber_ToJsonbValue(PyObject *obj, JsonbValue *jbvNum)
380380
{
381381
ereport(ERROR,
382382
(errcode(ERRCODE_DATATYPE_MISMATCH),
383-
(errmsg("could not convert value \"%s\" to jsonb", str))));
383+
errmsg("could not convert value \"%s\" to jsonb", str)));
384384
}
385385
PG_END_TRY();
386386

@@ -394,7 +394,7 @@ PLyNumber_ToJsonbValue(PyObject *obj, JsonbValue *jbvNum)
394394
if (numeric_is_nan(num))
395395
ereport(ERROR,
396396
(errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
397-
(errmsg("cannot convert NaN to jsonb"))));
397+
errmsg("cannot convert NaN to jsonb")));
398398

399399
jbvNum->type = jbvNumeric;
400400
jbvNum->val.numeric = num;
@@ -446,8 +446,8 @@ PLyObject_ToJsonbValue(PyObject *obj, JsonbParseState **jsonb_state, bool is_ele
446446
else
447447
ereport(ERROR,
448448
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
449-
(errmsg("Python type \"%s\" cannot be transformed to jsonb",
450-
PLyObject_AsString((PyObject *) obj->ob_type)))));
449+
errmsg("Python type \"%s\" cannot be transformed to jsonb",
450+
PLyObject_AsString((PyObject *) obj->ob_type))));
451451

452452
/* Push result into 'jsonb_state' unless it is raw scalar value. */
453453
return (*jsonb_state ?

contrib/pageinspect/brinfuncs.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ brin_page_type(PG_FUNCTION_ARGS)
5252
if (!superuser())
5353
ereport(ERROR,
5454
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
55-
(errmsg("must be superuser to use raw page functions"))));
55+
errmsg("must be superuser to use raw page functions")));
5656

5757
raw_page_size = VARSIZE(raw_page) - VARHDRSZ;
5858

@@ -141,7 +141,7 @@ brin_page_items(PG_FUNCTION_ARGS)
141141
if (!superuser())
142142
ereport(ERROR,
143143
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
144-
(errmsg("must be superuser to use raw page functions"))));
144+
errmsg("must be superuser to use raw page functions")));
145145

146146
/* check to see if caller supports us returning a tuplestore */
147147
if (rsinfo == NULL || !IsA(rsinfo, ReturnSetInfo))
@@ -336,7 +336,7 @@ brin_metapage_info(PG_FUNCTION_ARGS)
336336
if (!superuser())
337337
ereport(ERROR,
338338
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
339-
(errmsg("must be superuser to use raw page functions"))));
339+
errmsg("must be superuser to use raw page functions")));
340340

341341
page = verify_brin_page(raw_page, BRIN_PAGETYPE_META, "metapage");
342342

@@ -374,7 +374,7 @@ brin_revmap_data(PG_FUNCTION_ARGS)
374374
if (!superuser())
375375
ereport(ERROR,
376376
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
377-
(errmsg("must be superuser to use raw page functions"))));
377+
errmsg("must be superuser to use raw page functions")));
378378

379379
if (SRF_IS_FIRSTCALL())
380380
{

contrib/pageinspect/btreefuncs.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ bt_page_stats(PG_FUNCTION_ARGS)
174174
if (!superuser())
175175
ereport(ERROR,
176176
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
177-
(errmsg("must be superuser to use pageinspect functions"))));
177+
errmsg("must be superuser to use pageinspect functions")));
178178

179179
relrv = makeRangeVarFromNameList(textToQualifiedNameList(relname));
180180
rel = relation_openrv(relrv, AccessShareLock);
@@ -318,7 +318,7 @@ bt_page_items(PG_FUNCTION_ARGS)
318318
if (!superuser())
319319
ereport(ERROR,
320320
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
321-
(errmsg("must be superuser to use pageinspect functions"))));
321+
errmsg("must be superuser to use pageinspect functions")));
322322

323323
if (SRF_IS_FIRSTCALL())
324324
{
@@ -428,7 +428,7 @@ bt_page_items_bytea(PG_FUNCTION_ARGS)
428428
if (!superuser())
429429
ereport(ERROR,
430430
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
431-
(errmsg("must be superuser to use raw page functions"))));
431+
errmsg("must be superuser to use raw page functions")));
432432

433433
if (SRF_IS_FIRSTCALL())
434434
{
@@ -518,7 +518,7 @@ bt_metap(PG_FUNCTION_ARGS)
518518
if (!superuser())
519519
ereport(ERROR,
520520
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
521-
(errmsg("must be superuser to use pageinspect functions"))));
521+
errmsg("must be superuser to use pageinspect functions")));
522522

523523
relrv = makeRangeVarFromNameList(textToQualifiedNameList(relname));
524524
rel = relation_openrv(relrv, AccessShareLock);

contrib/pageinspect/fsmfuncs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ fsm_page_contents(PG_FUNCTION_ARGS)
4242
if (!superuser())
4343
ereport(ERROR,
4444
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
45-
(errmsg("must be superuser to use raw page functions"))));
45+
errmsg("must be superuser to use raw page functions")));
4646

4747
fsmpage = (FSMPage) PageGetContents(VARDATA(raw_page));
4848

contrib/pageinspect/ginfuncs.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ gin_metapage_info(PG_FUNCTION_ARGS)
4545
if (!superuser())
4646
ereport(ERROR,
4747
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
48-
(errmsg("must be superuser to use raw page functions"))));
48+
errmsg("must be superuser to use raw page functions")));
4949

5050
page = get_page_from_raw(raw_page);
5151

@@ -103,7 +103,7 @@ gin_page_opaque_info(PG_FUNCTION_ARGS)
103103
if (!superuser())
104104
ereport(ERROR,
105105
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
106-
(errmsg("must be superuser to use raw page functions"))));
106+
errmsg("must be superuser to use raw page functions")));
107107

108108
page = get_page_from_raw(raw_page);
109109

@@ -169,7 +169,7 @@ gin_leafpage_items(PG_FUNCTION_ARGS)
169169
if (!superuser())
170170
ereport(ERROR,
171171
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
172-
(errmsg("must be superuser to use raw page functions"))));
172+
errmsg("must be superuser to use raw page functions")));
173173

174174
if (SRF_IS_FIRSTCALL())
175175
{

contrib/pageinspect/hashfuncs.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ hash_page_type(PG_FUNCTION_ARGS)
195195
if (!superuser())
196196
ereport(ERROR,
197197
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
198-
(errmsg("must be superuser to use raw page functions"))));
198+
errmsg("must be superuser to use raw page functions")));
199199

200200
page = verify_hash_page(raw_page, 0);
201201

@@ -243,7 +243,7 @@ hash_page_stats(PG_FUNCTION_ARGS)
243243
if (!superuser())
244244
ereport(ERROR,
245245
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
246-
(errmsg("must be superuser to use raw page functions"))));
246+
errmsg("must be superuser to use raw page functions")));
247247

248248
page = verify_hash_page(raw_page, LH_BUCKET_PAGE | LH_OVERFLOW_PAGE);
249249

@@ -310,7 +310,7 @@ hash_page_items(PG_FUNCTION_ARGS)
310310
if (!superuser())
311311
ereport(ERROR,
312312
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
313-
(errmsg("must be superuser to use raw page functions"))));
313+
errmsg("must be superuser to use raw page functions")));
314314

315315
if (SRF_IS_FIRSTCALL())
316316
{
@@ -415,7 +415,7 @@ hash_bitmap_info(PG_FUNCTION_ARGS)
415415
if (!superuser())
416416
ereport(ERROR,
417417
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
418-
(errmsg("must be superuser to use raw page functions"))));
418+
errmsg("must be superuser to use raw page functions")));
419419

420420
indexRel = index_open(indexRelid, AccessShareLock);
421421

@@ -526,7 +526,7 @@ hash_metapage_info(PG_FUNCTION_ARGS)
526526
if (!superuser())
527527
ereport(ERROR,
528528
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
529-
(errmsg("must be superuser to use raw page functions"))));
529+
errmsg("must be superuser to use raw page functions")));
530530

531531
page = verify_hash_page(raw_page, LH_META_PAGE);
532532

contrib/pageinspect/heapfuncs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ heap_page_items(PG_FUNCTION_ARGS)
135135
if (!superuser())
136136
ereport(ERROR,
137137
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
138-
(errmsg("must be superuser to use raw page functions"))));
138+
errmsg("must be superuser to use raw page functions")));
139139

140140
raw_page_size = VARSIZE(raw_page) - VARHDRSZ;
141141

0 commit comments

Comments
 (0)