Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8e1d68c

Browse files
committed
Fix publication syntax error message
There was some odd wording in corner-case gram.y error messages "someerror ... at or near", which appears to have been modeled after "syntaxerror" messages. However, they don't work that way, and they're justwrong. They're also uncovered by tests. Remove the trailing words,and also add tests.They were introduced with5a28324; backpatch to 15.Author: Álvaro Herrera <alvherre@alvh.no-ip.org>
1 parentccd21e1 commit8e1d68c

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

‎src/backend/parser/gram.y

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18447,7 +18447,7 @@ preprocess_pubobj_list(List *pubobjspec_list, core_yyscan_t yyscanner)
1844718447
if (!pubobj->name && !pubobj->pubtable)
1844818448
ereport(ERROR,
1844918449
errcode(ERRCODE_SYNTAX_ERROR),
18450-
errmsg("invalid table name at or near"),
18450+
errmsg("invalid table name"),
1845118451
parser_errposition(pubobj->location));
1845218452

1845318453
if (pubobj->name)
@@ -18489,7 +18489,7 @@ preprocess_pubobj_list(List *pubobjspec_list, core_yyscan_t yyscanner)
1848918489
else
1849018490
ereport(ERROR,
1849118491
errcode(ERRCODE_SYNTAX_ERROR),
18492-
errmsg("invalid schema name at or near"),
18492+
errmsg("invalid schema name"),
1849318493
parser_errposition(pubobj->location));
1849418494
}
1849518495

‎src/test/regress/expected/publication.out

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,15 @@ Tables:
132132
Tables from schemas:
133133
"pub_test"
134134

135+
-- weird parser corner case
136+
CREATE PUBLICATION testpub_parsertst FOR TABLE pub_test.testpub_nopk, CURRENT_SCHEMA;
137+
ERROR: invalid table name
138+
LINE 1: ...estpub_parsertst FOR TABLE pub_test.testpub_nopk, CURRENT_SC...
139+
^
140+
CREATE PUBLICATION testpub_parsertst FOR TABLES IN SCHEMA foo, test.foo;
141+
ERROR: invalid schema name
142+
LINE 1: ...CATION testpub_parsertst FOR TABLES IN SCHEMA foo, test.foo;
143+
^
135144
-- should be able to add a table of the same schema to the schema publication
136145
ALTER PUBLICATION testpub_forschema ADD TABLE pub_test.testpub_nopk;
137146
\dRp+ testpub_forschema

‎src/test/regress/sql/publication.sql

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@ CREATE PUBLICATION testpub_for_tbl_schema FOR TABLES IN SCHEMA pub_test, TABLE p
7979
RESET client_min_messages;
8080
\dRp+ testpub_for_tbl_schema
8181

82+
-- weird parser corner case
83+
CREATE PUBLICATION testpub_parsertst FOR TABLEpub_test.testpub_nopk, CURRENT_SCHEMA;
84+
CREATE PUBLICATION testpub_parsertst FOR TABLESIN SCHEMA foo,test.foo;
85+
8286
-- should be able to add a table of the same schema to the schema publication
8387
ALTER PUBLICATION testpub_forschema ADD TABLEpub_test.testpub_nopk;
8488
\dRp+ testpub_forschema

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp