Commit c4dcd914 authored by Alvaro Herrera's avatar Alvaro Herrera

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
parent cce64a51
...@@ -1639,8 +1639,7 @@ dblink_build_sql_insert(PG_FUNCTION_ARGS) ...@@ -1639,8 +1639,7 @@ dblink_build_sql_insert(PG_FUNCTION_ARGS)
if (src_nitems != pknumatts) if (src_nitems != pknumatts)
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_ARRAY_SUBSCRIPT_ERROR), (errcode(ERRCODE_ARRAY_SUBSCRIPT_ERROR),
errmsg("source key array length must match number of key " \ errmsg("source key array length must match number of key attributes")));
"attributes")));
/* /*
* Target array is made up of key values that will be used to build the * 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) ...@@ -1654,8 +1653,7 @@ dblink_build_sql_insert(PG_FUNCTION_ARGS)
if (tgt_nitems != pknumatts) if (tgt_nitems != pknumatts)
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_ARRAY_SUBSCRIPT_ERROR), (errcode(ERRCODE_ARRAY_SUBSCRIPT_ERROR),
errmsg("target key array length must match number of key " \ errmsg("target key array length must match number of key attributes")));
"attributes")));
/* /*
* Prep work is finally done. Go get the SQL string. * Prep work is finally done. Go get the SQL string.
...@@ -1727,8 +1725,7 @@ dblink_build_sql_delete(PG_FUNCTION_ARGS) ...@@ -1727,8 +1725,7 @@ dblink_build_sql_delete(PG_FUNCTION_ARGS)
if (tgt_nitems != pknumatts) if (tgt_nitems != pknumatts)
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_ARRAY_SUBSCRIPT_ERROR), (errcode(ERRCODE_ARRAY_SUBSCRIPT_ERROR),
errmsg("target key array length must match number of key " \ errmsg("target key array length must match number of key attributes")));
"attributes")));
/* /*
* Prep work is finally done. Go get the SQL string. * Prep work is finally done. Go get the SQL string.
...@@ -1807,8 +1804,7 @@ dblink_build_sql_update(PG_FUNCTION_ARGS) ...@@ -1807,8 +1804,7 @@ dblink_build_sql_update(PG_FUNCTION_ARGS)
if (src_nitems != pknumatts) if (src_nitems != pknumatts)
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_ARRAY_SUBSCRIPT_ERROR), (errcode(ERRCODE_ARRAY_SUBSCRIPT_ERROR),
errmsg("source key array length must match number of key " \ errmsg("source key array length must match number of key attributes")));
"attributes")));
/* /*
* Target array is made up of key values that will be used to build the * 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) ...@@ -1822,8 +1818,7 @@ dblink_build_sql_update(PG_FUNCTION_ARGS)
if (tgt_nitems != pknumatts) if (tgt_nitems != pknumatts)
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_ARRAY_SUBSCRIPT_ERROR), (errcode(ERRCODE_ARRAY_SUBSCRIPT_ERROR),
errmsg("target key array length must match number of key " \ errmsg("target key array length must match number of key attributes")));
"attributes")));
/* /*
* Prep work is finally done. Go get the SQL string. * Prep work is finally done. Go get the SQL string.
......
...@@ -1415,8 +1415,7 @@ pg_stat_statements_internal(FunctionCallInfo fcinfo, ...@@ -1415,8 +1415,7 @@ pg_stat_statements_internal(FunctionCallInfo fcinfo,
if (!(rsinfo->allowedModes & SFRM_Materialize)) if (!(rsinfo->allowedModes & SFRM_Materialize))
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED), (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("materialize mode required, but it is not " \ errmsg("materialize mode required, but it is not allowed in this context")));
"allowed in this context")));
/* Switch into long-lived context to construct returned data structures */ /* Switch into long-lived context to construct returned data structures */
per_query_ctx = rsinfo->econtext->ecxt_per_query_memory; per_query_ctx = rsinfo->econtext->ecxt_per_query_memory;
......
...@@ -373,8 +373,7 @@ crosstab(PG_FUNCTION_ARGS) ...@@ -373,8 +373,7 @@ crosstab(PG_FUNCTION_ARGS)
if (!(rsinfo->allowedModes & SFRM_Materialize)) if (!(rsinfo->allowedModes & SFRM_Materialize))
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED), (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("materialize mode required, but it is not " \ errmsg("materialize mode required, but it is not allowed in this context")));
"allowed in this context")));
per_query_ctx = rsinfo->econtext->ecxt_per_query_memory; per_query_ctx = rsinfo->econtext->ecxt_per_query_memory;
...@@ -650,8 +649,7 @@ crosstab_hash(PG_FUNCTION_ARGS) ...@@ -650,8 +649,7 @@ crosstab_hash(PG_FUNCTION_ARGS)
rsinfo->expectedDesc == NULL) rsinfo->expectedDesc == NULL)
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED), (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("materialize mode required, but it is not " \ errmsg("materialize mode required, but it is not allowed in this context")));
"allowed in this context")));
per_query_ctx = rsinfo->econtext->ecxt_per_query_memory; per_query_ctx = rsinfo->econtext->ecxt_per_query_memory;
oldcontext = MemoryContextSwitchTo(per_query_ctx); oldcontext = MemoryContextSwitchTo(per_query_ctx);
...@@ -1011,8 +1009,7 @@ connectby_text(PG_FUNCTION_ARGS) ...@@ -1011,8 +1009,7 @@ connectby_text(PG_FUNCTION_ARGS)
rsinfo->expectedDesc == NULL) rsinfo->expectedDesc == NULL)
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED), (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("materialize mode required, but it is not " \ errmsg("materialize mode required, but it is not allowed in this context")));
"allowed in this context")));
if (fcinfo->nargs == 6) if (fcinfo->nargs == 6)
{ {
...@@ -1091,8 +1088,7 @@ connectby_text_serial(PG_FUNCTION_ARGS) ...@@ -1091,8 +1088,7 @@ connectby_text_serial(PG_FUNCTION_ARGS)
rsinfo->expectedDesc == NULL) rsinfo->expectedDesc == NULL)
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED), (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("materialize mode required, but it is not " \ errmsg("materialize mode required, but it is not allowed in this context")));
"allowed in this context")));
if (fcinfo->nargs == 7) if (fcinfo->nargs == 7)
{ {
......
...@@ -6135,9 +6135,7 @@ do { \ ...@@ -6135,9 +6135,7 @@ do { \
if ((currValue) < (minValue)) \ if ((currValue) < (minValue)) \
ereport(ERROR, \ ereport(ERROR, \
(errcode(ERRCODE_INVALID_PARAMETER_VALUE), \ (errcode(ERRCODE_INVALID_PARAMETER_VALUE), \
errmsg("hot standby is not possible because " \ errmsg("hot standby is not possible because %s = %d is a lower setting than on the master server (its value was %d)", \
"%s = %d is a lower setting than on the master server " \
"(its value was %d)", \
param_name, \ param_name, \
currValue, \ currValue, \
minValue))); \ minValue))); \
......
...@@ -186,8 +186,7 @@ pg_stop_backup_v2(PG_FUNCTION_ARGS) ...@@ -186,8 +186,7 @@ pg_stop_backup_v2(PG_FUNCTION_ARGS)
if (!(rsinfo->allowedModes & SFRM_Materialize)) if (!(rsinfo->allowedModes & SFRM_Materialize))
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED), (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("materialize mode required, but it is not " \ errmsg("materialize mode required, but it is not allowed in this context")));
"allowed in this context")));
/* Build a tuple descriptor for our result type */ /* Build a tuple descriptor for our result type */
if (get_call_result_type(fcinfo, NULL, &tupdesc) != TYPEFUNC_COMPOSITE) if (get_call_result_type(fcinfo, NULL, &tupdesc) != TYPEFUNC_COMPOSITE)
......
...@@ -1921,8 +1921,7 @@ pg_available_extensions(PG_FUNCTION_ARGS) ...@@ -1921,8 +1921,7 @@ pg_available_extensions(PG_FUNCTION_ARGS)
if (!(rsinfo->allowedModes & SFRM_Materialize)) if (!(rsinfo->allowedModes & SFRM_Materialize))
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED), (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("materialize mode required, but it is not " \ errmsg("materialize mode required, but it is not allowed in this context")));
"allowed in this context")));
/* Build a tuple descriptor for our result type */ /* Build a tuple descriptor for our result type */
if (get_call_result_type(fcinfo, NULL, &tupdesc) != TYPEFUNC_COMPOSITE) if (get_call_result_type(fcinfo, NULL, &tupdesc) != TYPEFUNC_COMPOSITE)
...@@ -2030,8 +2029,7 @@ pg_available_extension_versions(PG_FUNCTION_ARGS) ...@@ -2030,8 +2029,7 @@ pg_available_extension_versions(PG_FUNCTION_ARGS)
if (!(rsinfo->allowedModes & SFRM_Materialize)) if (!(rsinfo->allowedModes & SFRM_Materialize))
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED), (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("materialize mode required, but it is not " \ errmsg("materialize mode required, but it is not allowed in this context")));
"allowed in this context")));
/* Build a tuple descriptor for our result type */ /* Build a tuple descriptor for our result type */
if (get_call_result_type(fcinfo, NULL, &tupdesc) != TYPEFUNC_COMPOSITE) if (get_call_result_type(fcinfo, NULL, &tupdesc) != TYPEFUNC_COMPOSITE)
...@@ -2254,8 +2252,7 @@ pg_extension_update_paths(PG_FUNCTION_ARGS) ...@@ -2254,8 +2252,7 @@ pg_extension_update_paths(PG_FUNCTION_ARGS)
if (!(rsinfo->allowedModes & SFRM_Materialize)) if (!(rsinfo->allowedModes & SFRM_Materialize))
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED), (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("materialize mode required, but it is not " \ errmsg("materialize mode required, but it is not allowed in this context")));
"allowed in this context")));
/* Build a tuple descriptor for our result type */ /* Build a tuple descriptor for our result type */
if (get_call_result_type(fcinfo, NULL, &tupdesc) != TYPEFUNC_COMPOSITE) if (get_call_result_type(fcinfo, NULL, &tupdesc) != TYPEFUNC_COMPOSITE)
......
...@@ -714,8 +714,7 @@ pg_prepared_statement(PG_FUNCTION_ARGS) ...@@ -714,8 +714,7 @@ pg_prepared_statement(PG_FUNCTION_ARGS)
if (!(rsinfo->allowedModes & SFRM_Materialize)) if (!(rsinfo->allowedModes & SFRM_Materialize))
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED), (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("materialize mode required, but it is not " \ errmsg("materialize mode required, but it is not allowed in this context")));
"allowed in this context")));
/* need to build tuplestore in query context */ /* need to build tuplestore in query context */
per_query_ctx = rsinfo->econtext->ecxt_per_query_memory; per_query_ctx = rsinfo->econtext->ecxt_per_query_memory;
......
...@@ -2739,8 +2739,8 @@ ExecEvalArrayExpr(ExprState *state, ExprEvalStep *op) ...@@ -2739,8 +2739,8 @@ ExecEvalArrayExpr(ExprState *state, ExprEvalStep *op)
if (ndims <= 0 || ndims > MAXDIM) if (ndims <= 0 || ndims > MAXDIM)
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), (errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
errmsg("number of array dimensions (%d) exceeds " \ errmsg("number of array dimensions (%d) exceeds the maximum allowed (%d)",
"the maximum allowed (%d)", ndims, MAXDIM))); ndims, MAXDIM)));
elem_dims = (int *) palloc(elem_ndims * sizeof(int)); elem_dims = (int *) palloc(elem_ndims * sizeof(int));
memcpy(elem_dims, ARR_DIMS(array), elem_ndims * sizeof(int)); memcpy(elem_dims, ARR_DIMS(array), elem_ndims * sizeof(int));
......
...@@ -2667,8 +2667,7 @@ pg_hba_file_rules(PG_FUNCTION_ARGS) ...@@ -2667,8 +2667,7 @@ pg_hba_file_rules(PG_FUNCTION_ARGS)
if (!(rsi->allowedModes & SFRM_Materialize)) if (!(rsi->allowedModes & SFRM_Materialize))
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED), (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("materialize mode required, but it is not " \ errmsg("materialize mode required, but it is not allowed in this context")));
"allowed in this context")));
rsi->returnMode = SFRM_Materialize; rsi->returnMode = SFRM_Materialize;
......
...@@ -1087,8 +1087,7 @@ pg_stat_get_subscription(PG_FUNCTION_ARGS) ...@@ -1087,8 +1087,7 @@ pg_stat_get_subscription(PG_FUNCTION_ARGS)
if (!(rsinfo->allowedModes & SFRM_Materialize)) if (!(rsinfo->allowedModes & SFRM_Materialize))
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED), (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("materialize mode required, but it is not " \ errmsg("materialize mode required, but it is not allowed in this context")));
"allowed in this context")));
/* Build a tuple descriptor for our result type */ /* Build a tuple descriptor for our result type */
if (get_call_result_type(fcinfo, NULL, &tupdesc) != TYPEFUNC_COMPOSITE) if (get_call_result_type(fcinfo, NULL, &tupdesc) != TYPEFUNC_COMPOSITE)
......
...@@ -237,8 +237,7 @@ pg_get_replication_slots(PG_FUNCTION_ARGS) ...@@ -237,8 +237,7 @@ pg_get_replication_slots(PG_FUNCTION_ARGS)
if (!(rsinfo->allowedModes & SFRM_Materialize)) if (!(rsinfo->allowedModes & SFRM_Materialize))
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED), (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("materialize mode required, but it is not " \ errmsg("materialize mode required, but it is not allowed in this context")));
"allowed in this context")));
/* Build a tuple descriptor for our result type */ /* Build a tuple descriptor for our result type */
if (get_call_result_type(fcinfo, NULL, &tupdesc) != TYPEFUNC_COMPOSITE) if (get_call_result_type(fcinfo, NULL, &tupdesc) != TYPEFUNC_COMPOSITE)
......
...@@ -3196,8 +3196,7 @@ pg_stat_get_wal_senders(PG_FUNCTION_ARGS) ...@@ -3196,8 +3196,7 @@ pg_stat_get_wal_senders(PG_FUNCTION_ARGS)
if (!(rsinfo->allowedModes & SFRM_Materialize)) if (!(rsinfo->allowedModes & SFRM_Materialize))
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED), (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("materialize mode required, but it is not " \ errmsg("materialize mode required, but it is not allowed in this context")));
"allowed in this context")));
/* Build a tuple descriptor for our result type */ /* Build a tuple descriptor for our result type */
if (get_call_result_type(fcinfo, NULL, &tupdesc) != TYPEFUNC_COMPOSITE) if (get_call_result_type(fcinfo, NULL, &tupdesc) != TYPEFUNC_COMPOSITE)
......
...@@ -459,8 +459,7 @@ pg_stat_get_progress_info(PG_FUNCTION_ARGS) ...@@ -459,8 +459,7 @@ pg_stat_get_progress_info(PG_FUNCTION_ARGS)
if (!(rsinfo->allowedModes & SFRM_Materialize)) if (!(rsinfo->allowedModes & SFRM_Materialize))
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED), (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("materialize mode required, but it is not " \ errmsg("materialize mode required, but it is not allowed in this context")));
"allowed in this context")));
/* Build a tuple descriptor for our result type */ /* Build a tuple descriptor for our result type */
if (get_call_result_type(fcinfo, NULL, &tupdesc) != TYPEFUNC_COMPOSITE) if (get_call_result_type(fcinfo, NULL, &tupdesc) != TYPEFUNC_COMPOSITE)
...@@ -564,8 +563,7 @@ pg_stat_get_activity(PG_FUNCTION_ARGS) ...@@ -564,8 +563,7 @@ pg_stat_get_activity(PG_FUNCTION_ARGS)
if (!(rsinfo->allowedModes & SFRM_Materialize)) if (!(rsinfo->allowedModes & SFRM_Materialize))
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED), (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("materialize mode required, but it is not " \ errmsg("materialize mode required, but it is not allowed in this context")));
"allowed in this context")));
/* Build a tuple descriptor for our result type */ /* Build a tuple descriptor for our result type */
if (get_call_result_type(fcinfo, NULL, &tupdesc) != TYPEFUNC_COMPOSITE) if (get_call_result_type(fcinfo, NULL, &tupdesc) != TYPEFUNC_COMPOSITE)
......
...@@ -9507,8 +9507,7 @@ show_all_file_settings(PG_FUNCTION_ARGS) ...@@ -9507,8 +9507,7 @@ show_all_file_settings(PG_FUNCTION_ARGS)
if (!(rsinfo->allowedModes & SFRM_Materialize)) if (!(rsinfo->allowedModes & SFRM_Materialize))
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED), (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("materialize mode required, but it is not " \ errmsg("materialize mode required, but it is not allowed in this context")));
"allowed in this context")));
/* Scan the config files using current context as workspace */ /* Scan the config files using current context as workspace */
conf = ProcessConfigFileInternal(PGC_SIGHUP, false, DEBUG3); conf = ProcessConfigFileInternal(PGC_SIGHUP, false, DEBUG3);
......
...@@ -1135,8 +1135,7 @@ pg_cursor(PG_FUNCTION_ARGS) ...@@ -1135,8 +1135,7 @@ pg_cursor(PG_FUNCTION_ARGS)
if (!(rsinfo->allowedModes & SFRM_Materialize)) if (!(rsinfo->allowedModes & SFRM_Materialize))
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED), (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("materialize mode required, but it is not " \ errmsg("materialize mode required, but it is not allowed in this context")));
"allowed in this context")));
/* need to build tuplestore in query context */ /* need to build tuplestore in query context */
per_query_ctx = rsinfo->econtext->ecxt_per_query_memory; per_query_ctx = rsinfo->econtext->ecxt_per_query_memory;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment