1
0
mirror of https://github.com/postgres/postgres.git synced 2025-09-02 04:21:28 +03:00

Fix publication syntax error message

There was some odd wording in corner-case gram.y error messages "some
error ... at or near", which appears to have been modeled after "syntax
error" messages.  However, they don't work that way, and they're just
wrong.  They're also uncovered by tests.  Remove the trailing words,
and also add tests.

They were introduced with 5a2832465fd8; backpatch to 15.

Author: Álvaro Herrera <alvherre@alvh.no-ip.org>
This commit is contained in:
Alvaro Herrera
2023-05-10 18:26:10 +02:00
parent d8bcce1b5e
commit c39f2f68e9
3 changed files with 15 additions and 2 deletions

View File

@@ -18832,7 +18832,7 @@ preprocess_pubobj_list(List *pubobjspec_list, core_yyscan_t yyscanner)
if (!pubobj->name && !pubobj->pubtable)
ereport(ERROR,
errcode(ERRCODE_SYNTAX_ERROR),
errmsg("invalid table name at or near"),
errmsg("invalid table name"),
parser_errposition(pubobj->location));
if (pubobj->name)
@@ -18874,7 +18874,7 @@ preprocess_pubobj_list(List *pubobjspec_list, core_yyscan_t yyscanner)
else
ereport(ERROR,
errcode(ERRCODE_SYNTAX_ERROR),
errmsg("invalid schema name at or near"),
errmsg("invalid schema name"),
parser_errposition(pubobj->location));
}