1
0
mirror of https://github.com/postgres/postgres.git synced 2025-10-22 14:32:25 +03:00

Reword recent error messages: "should" -> "must"

Most were introduced in the 17 timeframe.  The ones in wparser_def.c are
very old.

I also changed "JSON path expression for column \"%s\" should return
single item without wrapper" to "JSON path expression for column \"%s\"
must return single item when no wrapper is requested" to avoid
ambiguity.

Backpatch to 17.

Crickets: https://postgr.es/m/202501131819.26ors7oouafu@alvherre.pgsql
This commit is contained in:
Álvaro Herrera
2025-01-21 15:24:49 +01:00
parent 9b21f203dd
commit db19a5061c
4 changed files with 15 additions and 15 deletions

View File

@@ -2671,19 +2671,19 @@ prsd_headline(PG_FUNCTION_ARGS)
if (min_words >= max_words)
ereport(ERROR,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("MinWords should be less than MaxWords")));
errmsg("%s must be less than %s", "MinWords", "MaxWords")));
if (min_words <= 0)
ereport(ERROR,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("MinWords should be positive")));
errmsg("%s must be positive", "MinWords")));
if (shortword < 0)
ereport(ERROR,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("ShortWord should be >= 0")));
errmsg("%s must be >= 0", "ShortWord")));
if (max_fragments < 0)
ereport(ERROR,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("MaxFragments should be >= 0")));
errmsg("%s must be >= 0", "MaxFragments")));
}
/* Locate words and phrases matching the query */