diff options
author | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2020-01-30 13:32:04 -0300 |
---|---|---|
committer | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2020-01-30 13:32:04 -0300 |
commit | 4e89c79a52f8a898edd648b56a00f0f4f840cfe7 (patch) | |
tree | ba259edb0559281eaf0953d6995781b264a1aec7 /contrib | |
parent | 2520cf8c2a0a1d679094dffbd99871884e620ed5 (diff) | |
download | postgresql-4e89c79a52f8a898edd648b56a00f0f4f840cfe7.tar.gz postgresql-4e89c79a52f8a898edd648b56a00f0f4f840cfe7.zip |
Remove excess parens in ereport() calls
Cosmetic cleanup, not worth backpatching.
Discussion: https://postgr.es/m/20200129200401.GA6303@alvherre.pgsql
Reviewed-by: Tom Lane, Michael Paquier
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/adminpack/adminpack.c | 12 | ||||
-rw-r--r-- | contrib/hstore_plperl/hstore_plperl.c | 2 | ||||
-rw-r--r-- | contrib/jsonb_plperl/jsonb_plperl.c | 6 | ||||
-rw-r--r-- | contrib/jsonb_plpython/jsonb_plpython.c | 8 | ||||
-rw-r--r-- | contrib/pageinspect/brinfuncs.c | 8 | ||||
-rw-r--r-- | contrib/pageinspect/btreefuncs.c | 8 | ||||
-rw-r--r-- | contrib/pageinspect/fsmfuncs.c | 2 | ||||
-rw-r--r-- | contrib/pageinspect/ginfuncs.c | 6 | ||||
-rw-r--r-- | contrib/pageinspect/hashfuncs.c | 10 | ||||
-rw-r--r-- | contrib/pageinspect/heapfuncs.c | 2 | ||||
-rw-r--r-- | contrib/pageinspect/rawpage.c | 6 | ||||
-rw-r--r-- | contrib/pg_prewarm/pg_prewarm.c | 4 | ||||
-rw-r--r-- | contrib/pgstattuple/pgstatapprox.c | 2 | ||||
-rw-r--r-- | contrib/pgstattuple/pgstatindex.c | 10 | ||||
-rw-r--r-- | contrib/pgstattuple/pgstattuple.c | 4 |
15 files changed, 45 insertions, 45 deletions
diff --git a/contrib/adminpack/adminpack.c b/contrib/adminpack/adminpack.c index 7b5a531e080..29b46aea3ec 100644 --- a/contrib/adminpack/adminpack.c +++ b/contrib/adminpack/adminpack.c @@ -93,7 +93,7 @@ convert_and_check_filename(text *arg, bool logAllowed) if (path_contains_parent_reference(filename)) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("reference to parent directory (\"..\") not allowed")))); + errmsg("reference to parent directory (\"..\") not allowed"))); /* * Allow absolute paths if within DataDir or Log_directory, even @@ -104,12 +104,12 @@ convert_and_check_filename(text *arg, bool logAllowed) !path_is_prefix_of_path(Log_directory, filename))) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("absolute path not allowed")))); + errmsg("absolute path not allowed"))); } else if (!path_is_relative_and_below_cwd(filename)) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("path must be in or below the current directory")))); + errmsg("path must be in or below the current directory"))); return filename; } @@ -124,7 +124,7 @@ requireSuperuser(void) if (!superuser()) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("only superuser may access generic file functions")))); + errmsg("only superuser may access generic file functions"))); } @@ -485,7 +485,7 @@ pg_logdir_ls(PG_FUNCTION_ARGS) if (!superuser()) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("only superuser can list the log directory")))); + errmsg("only superuser can list the log directory"))); return (pg_logdir_ls_internal(fcinfo)); } @@ -515,7 +515,7 @@ pg_logdir_ls_internal(FunctionCallInfo fcinfo) if (strcmp(Log_filename, "postgresql-%Y-%m-%d_%H%M%S.log") != 0) ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), - (errmsg("the log_filename parameter must equal 'postgresql-%%Y-%%m-%%d_%%H%%M%%S.log'")))); + errmsg("the log_filename parameter must equal 'postgresql-%%Y-%%m-%%d_%%H%%M%%S.log'"))); if (SRF_IS_FIRSTCALL()) { diff --git a/contrib/hstore_plperl/hstore_plperl.c b/contrib/hstore_plperl/hstore_plperl.c index 1316b0500be..417b721cff9 100644 --- a/contrib/hstore_plperl/hstore_plperl.c +++ b/contrib/hstore_plperl/hstore_plperl.c @@ -116,7 +116,7 @@ plperl_to_hstore(PG_FUNCTION_ARGS) if (SvTYPE(in) != SVt_PVHV) ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - (errmsg("cannot transform non-hash Perl value to hstore")))); + errmsg("cannot transform non-hash Perl value to hstore"))); hv = (HV *) in; pcount = hv_iterinit(hv); diff --git a/contrib/jsonb_plperl/jsonb_plperl.c b/contrib/jsonb_plperl/jsonb_plperl.c index 4ae13532d13..ed361efbe20 100644 --- a/contrib/jsonb_plperl/jsonb_plperl.c +++ b/contrib/jsonb_plperl/jsonb_plperl.c @@ -235,11 +235,11 @@ SV_to_JsonbValue(SV *in, JsonbParseState **jsonb_state, bool is_elem) if (isinf(nval)) ereport(ERROR, (errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE), - (errmsg("cannot convert infinity to jsonb")))); + errmsg("cannot convert infinity to jsonb"))); if (isnan(nval)) ereport(ERROR, (errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE), - (errmsg("cannot convert NaN to jsonb")))); + errmsg("cannot convert NaN to jsonb"))); out.type = jbvNumeric; out.val.numeric = @@ -260,7 +260,7 @@ SV_to_JsonbValue(SV *in, JsonbParseState **jsonb_state, bool is_elem) */ ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - (errmsg("cannot transform this Perl type to jsonb")))); + errmsg("cannot transform this Perl type to jsonb"))); return NULL; } } diff --git a/contrib/jsonb_plpython/jsonb_plpython.c b/contrib/jsonb_plpython/jsonb_plpython.c index b41c738ad62..b06ad9f9291 100644 --- a/contrib/jsonb_plpython/jsonb_plpython.c +++ b/contrib/jsonb_plpython/jsonb_plpython.c @@ -380,7 +380,7 @@ PLyNumber_ToJsonbValue(PyObject *obj, JsonbValue *jbvNum) { ereport(ERROR, (errcode(ERRCODE_DATATYPE_MISMATCH), - (errmsg("could not convert value \"%s\" to jsonb", str)))); + errmsg("could not convert value \"%s\" to jsonb", str))); } PG_END_TRY(); @@ -394,7 +394,7 @@ PLyNumber_ToJsonbValue(PyObject *obj, JsonbValue *jbvNum) if (numeric_is_nan(num)) ereport(ERROR, (errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE), - (errmsg("cannot convert NaN to jsonb")))); + errmsg("cannot convert NaN to jsonb"))); jbvNum->type = jbvNumeric; jbvNum->val.numeric = num; @@ -446,8 +446,8 @@ PLyObject_ToJsonbValue(PyObject *obj, JsonbParseState **jsonb_state, bool is_ele else ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - (errmsg("Python type \"%s\" cannot be transformed to jsonb", - PLyObject_AsString((PyObject *) obj->ob_type))))); + errmsg("Python type \"%s\" cannot be transformed to jsonb", + PLyObject_AsString((PyObject *) obj->ob_type)))); /* Push result into 'jsonb_state' unless it is raw scalar value. */ return (*jsonb_state ? diff --git a/contrib/pageinspect/brinfuncs.c b/contrib/pageinspect/brinfuncs.c index b1901cb03c1..fb32d74a66a 100644 --- a/contrib/pageinspect/brinfuncs.c +++ b/contrib/pageinspect/brinfuncs.c @@ -52,7 +52,7 @@ brin_page_type(PG_FUNCTION_ARGS) if (!superuser()) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("must be superuser to use raw page functions")))); + errmsg("must be superuser to use raw page functions"))); raw_page_size = VARSIZE(raw_page) - VARHDRSZ; @@ -141,7 +141,7 @@ brin_page_items(PG_FUNCTION_ARGS) if (!superuser()) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("must be superuser to use raw page functions")))); + errmsg("must be superuser to use raw page functions"))); /* check to see if caller supports us returning a tuplestore */ if (rsinfo == NULL || !IsA(rsinfo, ReturnSetInfo)) @@ -336,7 +336,7 @@ brin_metapage_info(PG_FUNCTION_ARGS) if (!superuser()) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("must be superuser to use raw page functions")))); + errmsg("must be superuser to use raw page functions"))); page = verify_brin_page(raw_page, BRIN_PAGETYPE_META, "metapage"); @@ -374,7 +374,7 @@ brin_revmap_data(PG_FUNCTION_ARGS) if (!superuser()) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("must be superuser to use raw page functions")))); + errmsg("must be superuser to use raw page functions"))); if (SRF_IS_FIRSTCALL()) { diff --git a/contrib/pageinspect/btreefuncs.c b/contrib/pageinspect/btreefuncs.c index 78cdc69ec7e..564c818558f 100644 --- a/contrib/pageinspect/btreefuncs.c +++ b/contrib/pageinspect/btreefuncs.c @@ -174,7 +174,7 @@ bt_page_stats(PG_FUNCTION_ARGS) if (!superuser()) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("must be superuser to use pageinspect functions")))); + errmsg("must be superuser to use pageinspect functions"))); relrv = makeRangeVarFromNameList(textToQualifiedNameList(relname)); rel = relation_openrv(relrv, AccessShareLock); @@ -318,7 +318,7 @@ bt_page_items(PG_FUNCTION_ARGS) if (!superuser()) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("must be superuser to use pageinspect functions")))); + errmsg("must be superuser to use pageinspect functions"))); if (SRF_IS_FIRSTCALL()) { @@ -428,7 +428,7 @@ bt_page_items_bytea(PG_FUNCTION_ARGS) if (!superuser()) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("must be superuser to use raw page functions")))); + errmsg("must be superuser to use raw page functions"))); if (SRF_IS_FIRSTCALL()) { @@ -518,7 +518,7 @@ bt_metap(PG_FUNCTION_ARGS) if (!superuser()) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("must be superuser to use pageinspect functions")))); + errmsg("must be superuser to use pageinspect functions"))); relrv = makeRangeVarFromNameList(textToQualifiedNameList(relname)); rel = relation_openrv(relrv, AccessShareLock); diff --git a/contrib/pageinspect/fsmfuncs.c b/contrib/pageinspect/fsmfuncs.c index e830be8060d..099acbb2fe4 100644 --- a/contrib/pageinspect/fsmfuncs.c +++ b/contrib/pageinspect/fsmfuncs.c @@ -42,7 +42,7 @@ fsm_page_contents(PG_FUNCTION_ARGS) if (!superuser()) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("must be superuser to use raw page functions")))); + errmsg("must be superuser to use raw page functions"))); fsmpage = (FSMPage) PageGetContents(VARDATA(raw_page)); diff --git a/contrib/pageinspect/ginfuncs.c b/contrib/pageinspect/ginfuncs.c index 4b623fbf514..9b1d41c510e 100644 --- a/contrib/pageinspect/ginfuncs.c +++ b/contrib/pageinspect/ginfuncs.c @@ -45,7 +45,7 @@ gin_metapage_info(PG_FUNCTION_ARGS) if (!superuser()) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("must be superuser to use raw page functions")))); + errmsg("must be superuser to use raw page functions"))); page = get_page_from_raw(raw_page); @@ -103,7 +103,7 @@ gin_page_opaque_info(PG_FUNCTION_ARGS) if (!superuser()) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("must be superuser to use raw page functions")))); + errmsg("must be superuser to use raw page functions"))); page = get_page_from_raw(raw_page); @@ -169,7 +169,7 @@ gin_leafpage_items(PG_FUNCTION_ARGS) if (!superuser()) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("must be superuser to use raw page functions")))); + errmsg("must be superuser to use raw page functions"))); if (SRF_IS_FIRSTCALL()) { diff --git a/contrib/pageinspect/hashfuncs.c b/contrib/pageinspect/hashfuncs.c index 5bbd230742d..effc80fbd3f 100644 --- a/contrib/pageinspect/hashfuncs.c +++ b/contrib/pageinspect/hashfuncs.c @@ -195,7 +195,7 @@ hash_page_type(PG_FUNCTION_ARGS) if (!superuser()) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("must be superuser to use raw page functions")))); + errmsg("must be superuser to use raw page functions"))); page = verify_hash_page(raw_page, 0); @@ -243,7 +243,7 @@ hash_page_stats(PG_FUNCTION_ARGS) if (!superuser()) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("must be superuser to use raw page functions")))); + errmsg("must be superuser to use raw page functions"))); page = verify_hash_page(raw_page, LH_BUCKET_PAGE | LH_OVERFLOW_PAGE); @@ -310,7 +310,7 @@ hash_page_items(PG_FUNCTION_ARGS) if (!superuser()) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("must be superuser to use raw page functions")))); + errmsg("must be superuser to use raw page functions"))); if (SRF_IS_FIRSTCALL()) { @@ -415,7 +415,7 @@ hash_bitmap_info(PG_FUNCTION_ARGS) if (!superuser()) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("must be superuser to use raw page functions")))); + errmsg("must be superuser to use raw page functions"))); indexRel = index_open(indexRelid, AccessShareLock); @@ -526,7 +526,7 @@ hash_metapage_info(PG_FUNCTION_ARGS) if (!superuser()) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("must be superuser to use raw page functions")))); + errmsg("must be superuser to use raw page functions"))); page = verify_hash_page(raw_page, LH_META_PAGE); diff --git a/contrib/pageinspect/heapfuncs.c b/contrib/pageinspect/heapfuncs.c index aa7e4b9fef8..61fe4359a0c 100644 --- a/contrib/pageinspect/heapfuncs.c +++ b/contrib/pageinspect/heapfuncs.c @@ -135,7 +135,7 @@ heap_page_items(PG_FUNCTION_ARGS) if (!superuser()) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("must be superuser to use raw page functions")))); + errmsg("must be superuser to use raw page functions"))); raw_page_size = VARSIZE(raw_page) - VARHDRSZ; diff --git a/contrib/pageinspect/rawpage.c b/contrib/pageinspect/rawpage.c index a7b0d177d27..c0181506a5d 100644 --- a/contrib/pageinspect/rawpage.c +++ b/contrib/pageinspect/rawpage.c @@ -102,7 +102,7 @@ get_raw_page_internal(text *relname, ForkNumber forknum, BlockNumber blkno) if (!superuser()) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("must be superuser to use raw page functions")))); + errmsg("must be superuser to use raw page functions"))); relrv = makeRangeVarFromNameList(textToQualifiedNameList(relname)); rel = relation_openrv(relrv, AccessShareLock); @@ -233,7 +233,7 @@ page_header(PG_FUNCTION_ARGS) if (!superuser()) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("must be superuser to use raw page functions")))); + errmsg("must be superuser to use raw page functions"))); raw_page_size = VARSIZE(raw_page) - VARHDRSZ; @@ -305,7 +305,7 @@ page_checksum(PG_FUNCTION_ARGS) if (!superuser()) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("must be superuser to use raw page functions")))); + errmsg("must be superuser to use raw page functions"))); raw_page_size = VARSIZE(raw_page) - VARHDRSZ; diff --git a/contrib/pg_prewarm/pg_prewarm.c b/contrib/pg_prewarm/pg_prewarm.c index b5ebac8f971..33e2d28b276 100644 --- a/contrib/pg_prewarm/pg_prewarm.c +++ b/contrib/pg_prewarm/pg_prewarm.c @@ -77,7 +77,7 @@ pg_prewarm(PG_FUNCTION_ARGS) if (PG_ARGISNULL(1)) ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), - (errmsg("prewarm type cannot be null")))); + errmsg("prewarm type cannot be null"))); type = PG_GETARG_TEXT_PP(1); ttype = text_to_cstring(type); if (strcmp(ttype, "prefetch") == 0) @@ -97,7 +97,7 @@ pg_prewarm(PG_FUNCTION_ARGS) if (PG_ARGISNULL(2)) ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), - (errmsg("relation fork cannot be null")))); + errmsg("relation fork cannot be null"))); forkName = PG_GETARG_TEXT_PP(2); forkString = text_to_cstring(forkName); forkNumber = forkname_to_number(forkString); diff --git a/contrib/pgstattuple/pgstatapprox.c b/contrib/pgstattuple/pgstatapprox.c index 672dbf2bb7a..96d837485fa 100644 --- a/contrib/pgstattuple/pgstatapprox.c +++ b/contrib/pgstattuple/pgstatapprox.c @@ -228,7 +228,7 @@ pgstattuple_approx(PG_FUNCTION_ARGS) if (!superuser()) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("must be superuser to use pgstattuple functions")))); + errmsg("must be superuser to use pgstattuple functions"))); PG_RETURN_DATUM(pgstattuple_approx_internal(relid, fcinfo)); } diff --git a/contrib/pgstattuple/pgstatindex.c b/contrib/pgstattuple/pgstatindex.c index 4bae176e09e..b1ce0d77d73 100644 --- a/contrib/pgstattuple/pgstatindex.c +++ b/contrib/pgstattuple/pgstatindex.c @@ -151,7 +151,7 @@ pgstatindex(PG_FUNCTION_ARGS) if (!superuser()) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("must be superuser to use pgstattuple functions")))); + errmsg("must be superuser to use pgstattuple functions"))); relrv = makeRangeVarFromNameList(textToQualifiedNameList(relname)); rel = relation_openrv(relrv, AccessShareLock); @@ -193,7 +193,7 @@ pgstatindexbyid(PG_FUNCTION_ARGS) if (!superuser()) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("must be superuser to use pgstattuple functions")))); + errmsg("must be superuser to use pgstattuple functions"))); rel = relation_open(relid, AccessShareLock); @@ -386,7 +386,7 @@ pg_relpages(PG_FUNCTION_ARGS) if (!superuser()) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("must be superuser to use pgstattuple functions")))); + errmsg("must be superuser to use pgstattuple functions"))); relrv = makeRangeVarFromNameList(textToQualifiedNameList(relname)); rel = relation_openrv(relrv, AccessShareLock); @@ -438,7 +438,7 @@ pg_relpagesbyid(PG_FUNCTION_ARGS) if (!superuser()) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("must be superuser to use pgstattuple functions")))); + errmsg("must be superuser to use pgstattuple functions"))); rel = relation_open(relid, AccessShareLock); @@ -492,7 +492,7 @@ pgstatginindex(PG_FUNCTION_ARGS) if (!superuser()) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("must be superuser to use pgstattuple functions")))); + errmsg("must be superuser to use pgstattuple functions"))); PG_RETURN_DATUM(pgstatginindex_internal(relid, fcinfo)); } diff --git a/contrib/pgstattuple/pgstattuple.c b/contrib/pgstattuple/pgstattuple.c index 70af43ebd5a..69179d4104d 100644 --- a/contrib/pgstattuple/pgstattuple.c +++ b/contrib/pgstattuple/pgstattuple.c @@ -173,7 +173,7 @@ pgstattuple(PG_FUNCTION_ARGS) if (!superuser()) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("must be superuser to use pgstattuple functions")))); + errmsg("must be superuser to use pgstattuple functions"))); /* open relation */ relrv = makeRangeVarFromNameList(textToQualifiedNameList(relname)); @@ -213,7 +213,7 @@ pgstattuplebyid(PG_FUNCTION_ARGS) if (!superuser()) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("must be superuser to use pgstattuple functions")))); + errmsg("must be superuser to use pgstattuple functions"))); /* open relation */ rel = relation_open(relid, AccessShareLock); |