diff options
author | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2024-08-07 11:30:36 -0400 |
---|---|---|
committer | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2024-08-07 11:30:36 -0400 |
commit | 899f39ea25f2ee63a0c557f3908e15b280a4367a (patch) | |
tree | 0fc7fa2c1b1b7c91ee89dedee100db5c58654d3c /src/backend/parser/parse_jsontable.c | |
parent | ffac8ac48e409bbc7c2d9a4b37a1c39908ca24eb (diff) | |
download | postgresql-899f39ea25f2ee63a0c557f3908e15b280a4367a.tar.gz postgresql-899f39ea25f2ee63a0c557f3908e15b280a4367a.zip |
Refactor/reword some error messages to avoid duplicates
Also, remove brackets around "EMPTY [ ARRAY ]". An error message is
not the place to state that a keyword is optional.
Backpatch to 17.
Diffstat (limited to 'src/backend/parser/parse_jsontable.c')
-rw-r--r-- | src/backend/parser/parse_jsontable.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/parser/parse_jsontable.c b/src/backend/parser/parse_jsontable.c index 8a72e498e89..6d4e4968202 100644 --- a/src/backend/parser/parse_jsontable.c +++ b/src/backend/parser/parse_jsontable.c @@ -91,7 +91,7 @@ transformJsonTable(ParseState *pstate, JsonTable *jt) jt->on_error->btype != JSON_BEHAVIOR_EMPTY_ARRAY) ereport(ERROR, errcode(ERRCODE_SYNTAX_ERROR), - errmsg("invalid ON ERROR behavior"), + errmsg("invalid %s behavior", "ON ERROR"), errdetail("Only EMPTY [ ARRAY ] or ERROR is allowed in the top-level ON ERROR clause."), parser_errposition(pstate, jt->on_error->location)); @@ -292,7 +292,7 @@ transformJsonTableColumns(JsonTableParseContext *cxt, List *columns, if (ordinality_found) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), - errmsg("cannot use more than one FOR ORDINALITY column"), + errmsg("only one FOR ORDINALITY column is allowed"), parser_errposition(pstate, rawc->location))); ordinality_found = true; colexpr = NULL; |