summaryrefslogtreecommitdiff
path: root/src/backend/parser
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2022-09-22 19:02:25 +0200
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2022-09-22 19:02:25 +0200
commitf256236fb1b00e9d05f889a53e93feeecbd50991 (patch)
treeac571177516b220cff0b9d85cf15db5687048dda /src/backend/parser
parent5f56933ea5d5b0b1a0bbe4c7b8f5110f8fe256ed (diff)
Remove ALL keyword from TABLES IN SCHEMA for publication
This may be a bit too subtle, but removing that word from there makes this clause no longer a perfect parallel of the GRANT variant "ALL TABLES IN SCHEMA": indeed, for publications what we record is the schema itself, not the tables therein, which means that any tables added to the schema in the future are also published. This is completely different to what GRANT does, which is affect only the tables that exist when the command is executed. There isn't resounding support for this change, but there are a few positive votes and no opposition. Because the time to 15 RC1 is very short, let's get this out now. Backpatch to 15. Discussion: https://postgr.es/m/2729c9e2-9aac-8cda-f2f4-34f2bcc18f4e
Diffstat (limited to 'src/backend/parser')
-rw-r--r--src/backend/parser/gram.y18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y
index e25b9a85e33..fe04db6d330 100644
--- a/src/backend/parser/gram.y
+++ b/src/backend/parser/gram.y
@@ -10303,7 +10303,7 @@ AlterOwnerStmt: ALTER AGGREGATE aggregate_with_argtypes OWNER TO RoleSpec
* pub_obj is one of:
*
* TABLE table [, ...]
- * ALL TABLES IN SCHEMA schema [, ...]
+ * TABLES IN SCHEMA schema [, ...]
*
*****************************************************************************/
@@ -10338,7 +10338,7 @@ CreatePublicationStmt:
;
/*
- * FOR TABLE and FOR ALL TABLES IN SCHEMA specifications
+ * FOR TABLE and FOR TABLES IN SCHEMA specifications
*
* This rule parses publication objects with and without keyword prefixes.
*
@@ -10360,18 +10360,18 @@ PublicationObjSpec:
$$->pubtable->columns = $3;
$$->pubtable->whereClause = $4;
}
- | ALL TABLES IN_P SCHEMA ColId
+ | TABLES IN_P SCHEMA ColId
{
$$ = makeNode(PublicationObjSpec);
$$->pubobjtype = PUBLICATIONOBJ_TABLES_IN_SCHEMA;
- $$->name = $5;
- $$->location = @5;
+ $$->name = $4;
+ $$->location = @4;
}
- | ALL TABLES IN_P SCHEMA CURRENT_SCHEMA
+ | TABLES IN_P SCHEMA CURRENT_SCHEMA
{
$$ = makeNode(PublicationObjSpec);
$$->pubobjtype = PUBLICATIONOBJ_TABLES_IN_CUR_SCHEMA;
- $$->location = @5;
+ $$->location = @4;
}
| ColId opt_column_list OptWhereClause
{
@@ -10447,7 +10447,7 @@ pub_obj_list: PublicationObjSpec
* pub_obj is one of:
*
* TABLE table_name [, ...]
- * ALL TABLES IN SCHEMA schema_name [, ...]
+ * TABLES IN SCHEMA schema_name [, ...]
*
*****************************************************************************/
@@ -18431,7 +18431,7 @@ preprocess_pubobj_list(List *pubobjspec_list, core_yyscan_t yyscanner)
ereport(ERROR,
errcode(ERRCODE_SYNTAX_ERROR),
errmsg("invalid publication object list"),
- errdetail("One of TABLE or ALL TABLES IN SCHEMA must be specified before a standalone table or schema name."),
+ errdetail("One of TABLE or TABLES IN SCHEMA must be specified before a standalone table or schema name."),
parser_errposition(pubobj->location));
foreach(cell, pubobjspec_list)