aboutsummaryrefslogtreecommitdiff
path: root/src/backend/parser
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2021-12-30 19:24:26 -0300
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2021-12-30 19:24:26 -0300
commitc9105dd3660f4a801e6f87a1ed68189bd30576bf (patch)
treeb0edaababb4d2a501670b28e971c9c15e8d0eb14 /src/backend/parser
parentc7cf73eb7b9e7911748ebe117a7219f21e504121 (diff)
downloadpostgresql-c9105dd3660f4a801e6f87a1ed68189bd30576bf.tar.gz
postgresql-c9105dd3660f4a801e6f87a1ed68189bd30576bf.zip
Small cleanups related to PUBLICATION framework code
Discussion: https://postgr.es/m/202112302021.ca7ihogysgh3@alvherre.pgsql
Diffstat (limited to 'src/backend/parser')
-rw-r--r--src/backend/parser/gram.y20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y
index 2a319eecda0..f3c232842d6 100644
--- a/src/backend/parser/gram.y
+++ b/src/backend/parser/gram.y
@@ -9750,14 +9750,14 @@ PublicationObjSpec:
| ALL TABLES IN_P SCHEMA ColId
{
$$ = makeNode(PublicationObjSpec);
- $$->pubobjtype = PUBLICATIONOBJ_TABLE_IN_SCHEMA;
+ $$->pubobjtype = PUBLICATIONOBJ_TABLES_IN_SCHEMA;
$$->name = $5;
$$->location = @5;
}
| ALL TABLES IN_P SCHEMA CURRENT_SCHEMA
{
$$ = makeNode(PublicationObjSpec);
- $$->pubobjtype = PUBLICATIONOBJ_TABLE_IN_CUR_SCHEMA;
+ $$->pubobjtype = PUBLICATIONOBJ_TABLES_IN_CUR_SCHEMA;
$$->location = @5;
}
| ColId
@@ -17411,7 +17411,8 @@ preprocess_pubobj_list(List *pubobjspec_list, core_yyscan_t yyscanner)
if (pubobj->pubobjtype == PUBLICATIONOBJ_CONTINUATION)
ereport(ERROR,
errcode(ERRCODE_SYNTAX_ERROR),
- errmsg("TABLE/ALL TABLES IN SCHEMA should be specified before the table/schema name(s)"),
+ errmsg("invalid publication object list"),
+ errdetail("One of TABLE or ALL TABLES IN SCHEMA must be specified before a standalone table or schema name."),
parser_errposition(pubobj->location));
foreach(cell, pubobjspec_list)
@@ -17433,23 +17434,24 @@ preprocess_pubobj_list(List *pubobjspec_list, core_yyscan_t yyscanner)
{
/* convert it to PublicationTable */
PublicationTable *pubtable = makeNode(PublicationTable);
- pubtable->relation = makeRangeVar(NULL, pubobj->name,
- pubobj->location);
+
+ pubtable->relation =
+ makeRangeVar(NULL, pubobj->name, pubobj->location);
pubobj->pubtable = pubtable;
pubobj->name = NULL;
}
}
- else if (pubobj->pubobjtype == PUBLICATIONOBJ_TABLE_IN_SCHEMA ||
- pubobj->pubobjtype == PUBLICATIONOBJ_TABLE_IN_CUR_SCHEMA)
+ else if (pubobj->pubobjtype == PUBLICATIONOBJ_TABLES_IN_SCHEMA ||
+ pubobj->pubobjtype == PUBLICATIONOBJ_TABLES_IN_CUR_SCHEMA)
{
/*
* We can distinguish between the different type of schema
* objects based on whether name and pubtable is set.
*/
if (pubobj->name)
- pubobj->pubobjtype = PUBLICATIONOBJ_TABLE_IN_SCHEMA;
+ pubobj->pubobjtype = PUBLICATIONOBJ_TABLES_IN_SCHEMA;
else if (!pubobj->name && !pubobj->pubtable)
- pubobj->pubobjtype = PUBLICATIONOBJ_TABLE_IN_CUR_SCHEMA;
+ pubobj->pubobjtype = PUBLICATIONOBJ_TABLES_IN_CUR_SCHEMA;
else
ereport(ERROR,
errcode(ERRCODE_SYNTAX_ERROR),