diff options
| author | Álvaro Herrera | 2025-01-21 14:24:49 +0000 |
|---|---|---|
| committer | Álvaro Herrera | 2025-01-21 14:24:49 +0000 |
| commit | dbc3499a0bcb544d30ec4f6fe576b28ce0a7951f (patch) | |
| tree | 4d0d8f7ce39a5d9a4ec442942adf5dbc858f5eda /src/test | |
| parent | 2f30847d1d04bafa51a17886e132892e38df093f (diff) | |
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/test')
| -rw-r--r-- | src/test/regress/expected/sqljson_jsontable.out | 2 | ||||
| -rw-r--r-- | src/test/regress/expected/sqljson_queryfuncs.out | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/test/regress/expected/sqljson_jsontable.out b/src/test/regress/expected/sqljson_jsontable.out index 7a698934ac9..8ab061f9f7b 100644 --- a/src/test/regress/expected/sqljson_jsontable.out +++ b/src/test/regress/expected/sqljson_jsontable.out @@ -709,7 +709,7 @@ LINE 1: SELECT * FROM JSON_TABLE(jsonb '{"a": 123}', '$' || '.' || '... ^ -- JsonPathQuery() error message mentioning column name SELECT * FROM JSON_TABLE('{"a": [{"b": "1"}, {"b": "2"}]}', '$' COLUMNS (b json path '$.a[*].b' ERROR ON ERROR)); -ERROR: JSON path expression for column "b" should return single item without wrapper +ERROR: JSON path expression for column "b" must return single item when no wrapper is requested HINT: Use the WITH WRAPPER clause to wrap SQL/JSON items into an array. -- JSON_TABLE: nested paths -- Duplicate path names diff --git a/src/test/regress/expected/sqljson_queryfuncs.out b/src/test/regress/expected/sqljson_queryfuncs.out index 329ef674961..5a35aeb7bba 100644 --- a/src/test/regress/expected/sqljson_queryfuncs.out +++ b/src/test/regress/expected/sqljson_queryfuncs.out @@ -344,7 +344,7 @@ SELECT JSON_VALUE(jsonb '[]', '$'); (1 row) SELECT JSON_VALUE(jsonb '[]', '$' ERROR ON ERROR); -ERROR: JSON path expression in JSON_VALUE should return single scalar item +ERROR: JSON path expression in JSON_VALUE must return single scalar item SELECT JSON_VALUE(jsonb '{}', '$'); json_value ------------ @@ -352,7 +352,7 @@ SELECT JSON_VALUE(jsonb '{}', '$'); (1 row) SELECT JSON_VALUE(jsonb '{}', '$' ERROR ON ERROR); -ERROR: JSON path expression in JSON_VALUE should return single scalar item +ERROR: JSON path expression in JSON_VALUE must return single scalar item SELECT JSON_VALUE(jsonb '1', '$.a'); json_value ------------ @@ -408,7 +408,7 @@ SELECT JSON_VALUE(jsonb '1', 'lax $.a' DEFAULT '2' ON EMPTY DEFAULT '3' ON ERROR SELECT JSON_VALUE(jsonb '1', 'lax $.a' ERROR ON EMPTY DEFAULT '3' ON ERROR); ERROR: no SQL/JSON item found for specified path SELECT JSON_VALUE(jsonb '[1,2]', '$[*]' ERROR ON ERROR); -ERROR: JSON path expression in JSON_VALUE should return single scalar item +ERROR: JSON path expression in JSON_VALUE must return single scalar item SELECT JSON_VALUE(jsonb '[1,2]', '$[*]' DEFAULT '0' ON ERROR); json_value ------------ @@ -806,7 +806,7 @@ SELECT JSON_QUERY(jsonb '[]', '$[*]' ERROR ON ERROR); -- NULL ON EMPTY (1 row) SELECT JSON_QUERY(jsonb '[1,2]', '$[*]' ERROR ON ERROR); -ERROR: JSON path expression in JSON_QUERY should return single item without wrapper +ERROR: JSON path expression in JSON_QUERY must return single item when no wrapper is requested HINT: Use the WITH WRAPPER clause to wrap SQL/JSON items into an array. SELECT JSON_QUERY(jsonb '[1,2]', '$[*]' DEFAULT '"empty"' ON ERROR); json_query |
