diff options
| author | Alvaro Herrera | 2019-12-24 15:37:13 +0000 |
|---|---|---|
| committer | Alvaro Herrera | 2019-12-24 15:44:12 +0000 |
| commit | c4dcd9144ba64946c9f9466748bdb2c51719c8a3 (patch) | |
| tree | f0c19d717fa5c6a61d5de600d9720234e460041a /contrib | |
| parent | cce64a51cabc1e59d202d95bb0b92ed22bac73cf (diff) | |
Avoid splitting C string literals with \-newline
Using \ is unnecessary and ugly, so remove that. While at it, stitch
the literals back into a single line: we've long discouraged splitting
error message literals even when they go past the 80 chars line limit,
to improve greppability.
Leave contrib/tablefunc alone.
Discussion: https://postgr.es/m/20191223195156.GA12271@alvherre.pgsql
Diffstat (limited to 'contrib')
| -rw-r--r-- | contrib/dblink/dblink.c | 15 | ||||
| -rw-r--r-- | contrib/pg_stat_statements/pg_stat_statements.c | 3 | ||||
| -rw-r--r-- | contrib/tablefunc/tablefunc.c | 12 |
3 files changed, 10 insertions, 20 deletions
diff --git a/contrib/dblink/dblink.c b/contrib/dblink/dblink.c index 7e225589a9b..a28b080059f 100644 --- a/contrib/dblink/dblink.c +++ b/contrib/dblink/dblink.c @@ -1639,8 +1639,7 @@ dblink_build_sql_insert(PG_FUNCTION_ARGS) if (src_nitems != pknumatts) ereport(ERROR, (errcode(ERRCODE_ARRAY_SUBSCRIPT_ERROR), - errmsg("source key array length must match number of key " \ - "attributes"))); + errmsg("source key array length must match number of key attributes"))); /* * Target array is made up of key values that will be used to build the @@ -1654,8 +1653,7 @@ dblink_build_sql_insert(PG_FUNCTION_ARGS) if (tgt_nitems != pknumatts) ereport(ERROR, (errcode(ERRCODE_ARRAY_SUBSCRIPT_ERROR), - errmsg("target key array length must match number of key " \ - "attributes"))); + errmsg("target key array length must match number of key attributes"))); /* * Prep work is finally done. Go get the SQL string. @@ -1727,8 +1725,7 @@ dblink_build_sql_delete(PG_FUNCTION_ARGS) if (tgt_nitems != pknumatts) ereport(ERROR, (errcode(ERRCODE_ARRAY_SUBSCRIPT_ERROR), - errmsg("target key array length must match number of key " \ - "attributes"))); + errmsg("target key array length must match number of key attributes"))); /* * Prep work is finally done. Go get the SQL string. @@ -1807,8 +1804,7 @@ dblink_build_sql_update(PG_FUNCTION_ARGS) if (src_nitems != pknumatts) ereport(ERROR, (errcode(ERRCODE_ARRAY_SUBSCRIPT_ERROR), - errmsg("source key array length must match number of key " \ - "attributes"))); + errmsg("source key array length must match number of key attributes"))); /* * Target array is made up of key values that will be used to build the @@ -1822,8 +1818,7 @@ dblink_build_sql_update(PG_FUNCTION_ARGS) if (tgt_nitems != pknumatts) ereport(ERROR, (errcode(ERRCODE_ARRAY_SUBSCRIPT_ERROR), - errmsg("target key array length must match number of key " \ - "attributes"))); + errmsg("target key array length must match number of key attributes"))); /* * Prep work is finally done. Go get the SQL string. diff --git a/contrib/pg_stat_statements/pg_stat_statements.c b/contrib/pg_stat_statements/pg_stat_statements.c index 63b5888ebbc..0590a6769b4 100644 --- a/contrib/pg_stat_statements/pg_stat_statements.c +++ b/contrib/pg_stat_statements/pg_stat_statements.c @@ -1415,8 +1415,7 @@ pg_stat_statements_internal(FunctionCallInfo fcinfo, if (!(rsinfo->allowedModes & SFRM_Materialize)) ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("materialize mode required, but it is not " \ - "allowed in this context"))); + errmsg("materialize mode required, but it is not allowed in this context"))); /* Switch into long-lived context to construct returned data structures */ per_query_ctx = rsinfo->econtext->ecxt_per_query_memory; diff --git a/contrib/tablefunc/tablefunc.c b/contrib/tablefunc/tablefunc.c index 1072827784f..9ab63088e87 100644 --- a/contrib/tablefunc/tablefunc.c +++ b/contrib/tablefunc/tablefunc.c @@ -373,8 +373,7 @@ crosstab(PG_FUNCTION_ARGS) if (!(rsinfo->allowedModes & SFRM_Materialize)) ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("materialize mode required, but it is not " \ - "allowed in this context"))); + errmsg("materialize mode required, but it is not allowed in this context"))); per_query_ctx = rsinfo->econtext->ecxt_per_query_memory; @@ -650,8 +649,7 @@ crosstab_hash(PG_FUNCTION_ARGS) rsinfo->expectedDesc == NULL) ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("materialize mode required, but it is not " \ - "allowed in this context"))); + errmsg("materialize mode required, but it is not allowed in this context"))); per_query_ctx = rsinfo->econtext->ecxt_per_query_memory; oldcontext = MemoryContextSwitchTo(per_query_ctx); @@ -1011,8 +1009,7 @@ connectby_text(PG_FUNCTION_ARGS) rsinfo->expectedDesc == NULL) ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("materialize mode required, but it is not " \ - "allowed in this context"))); + errmsg("materialize mode required, but it is not allowed in this context"))); if (fcinfo->nargs == 6) { @@ -1091,8 +1088,7 @@ connectby_text_serial(PG_FUNCTION_ARGS) rsinfo->expectedDesc == NULL) ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("materialize mode required, but it is not " \ - "allowed in this context"))); + errmsg("materialize mode required, but it is not allowed in this context"))); if (fcinfo->nargs == 7) { |
