diff options
author | Álvaro Herrera <alvherre@alvh.no-ip.org> | 2025-01-21 15:24:49 +0100 |
---|---|---|
committer | Álvaro Herrera <alvherre@alvh.no-ip.org> | 2025-01-21 15:24:49 +0100 |
commit | dbc3499a0bcb544d30ec4f6fe576b28ce0a7951f (patch) | |
tree | 4d0d8f7ce39a5d9a4ec442942adf5dbc858f5eda /src/backend/utils/adt/jsonpath_exec.c | |
parent | 2f30847d1d04bafa51a17886e132892e38df093f (diff) | |
download | postgresql-dbc3499a0bcb544d30ec4f6fe576b28ce0a7951f.tar.gz postgresql-dbc3499a0bcb544d30ec4f6fe576b28ce0a7951f.zip |
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
Diffstat (limited to 'src/backend/utils/adt/jsonpath_exec.c')
-rw-r--r-- | src/backend/utils/adt/jsonpath_exec.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/backend/utils/adt/jsonpath_exec.c b/src/backend/utils/adt/jsonpath_exec.c index 1184cba983a..accadff6d8a 100644 --- a/src/backend/utils/adt/jsonpath_exec.c +++ b/src/backend/utils/adt/jsonpath_exec.c @@ -3978,13 +3978,13 @@ JsonPathQuery(Datum jb, JsonPath *jp, JsonWrapper wrapper, bool *empty, if (column_name) ereport(ERROR, (errcode(ERRCODE_MORE_THAN_ONE_SQL_JSON_ITEM), - errmsg("JSON path expression for column \"%s\" should return single item without wrapper", + errmsg("JSON path expression for column \"%s\" must return single item when no wrapper is requested", column_name), errhint("Use the WITH WRAPPER clause to wrap SQL/JSON items into an array."))); else ereport(ERROR, (errcode(ERRCODE_MORE_THAN_ONE_SQL_JSON_ITEM), - errmsg("JSON path expression in JSON_QUERY should return single item without wrapper"), + errmsg("JSON path expression in JSON_QUERY must return single item when no wrapper is requested"), errhint("Use the WITH WRAPPER clause to wrap SQL/JSON items into an array."))); } @@ -4042,12 +4042,12 @@ JsonPathValue(Datum jb, JsonPath *jp, bool *empty, bool *error, List *vars, if (column_name) ereport(ERROR, (errcode(ERRCODE_MORE_THAN_ONE_SQL_JSON_ITEM), - errmsg("JSON path expression for column \"%s\" should return single scalar item", + errmsg("JSON path expression for column \"%s\" must return single scalar item", column_name))); else ereport(ERROR, (errcode(ERRCODE_MORE_THAN_ONE_SQL_JSON_ITEM), - errmsg("JSON path expression in JSON_VALUE should return single scalar item"))); + errmsg("JSON path expression in JSON_VALUE must return single scalar item"))); } res = JsonValueListHead(&found); @@ -4066,12 +4066,12 @@ JsonPathValue(Datum jb, JsonPath *jp, bool *empty, bool *error, List *vars, if (column_name) ereport(ERROR, (errcode(ERRCODE_SQL_JSON_SCALAR_REQUIRED), - errmsg("JSON path expression for column \"%s\" should return single scalar item", + errmsg("JSON path expression for column \"%s\" must return single scalar item", column_name))); else ereport(ERROR, (errcode(ERRCODE_SQL_JSON_SCALAR_REQUIRED), - errmsg("JSON path expression in JSON_VALUE should return single scalar item"))); + errmsg("JSON path expression in JSON_VALUE must return single scalar item"))); } if (res->type == jbvNull) |