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 | 2bb969f3998489e5dc4fe9f2a61185b43581975d (patch) | |
tree | ef08aa9d05f0e8c029fff450da5887ed3831ce96 /src/backend/parser/parse_jsontable.c | |
parent | 22b4a1b561f830f2af80c21450a4c05f6efbb698 (diff) | |
download | postgresql-2bb969f3998489e5dc4fe9f2a61185b43581975d.tar.gz postgresql-2bb969f3998489e5dc4fe9f2a61185b43581975d.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; |