1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-15 03:41:20 +03:00

Remove unused assignment in CREATE PUBLICATION grammar.

Commit 96b3784973 extended the grammar for CREATE PUBLICATION to support
the ALL SEQUENCES variant. However, it unnecessarily prepared publication
objects for this variant, which is not required. This was a copy-paste
oversight in that commit.

Additionally, rename pub_obj_type_list to pub_all_obj_type_list to better
reflect its purpose.

Author: Shlok Kyal <shlok.kyal.oss@gmail.com>
Reviewed-by: Vignesh C <vignesh21@gmail.com>
Reviewed-by: Amit Kapila <amit.kapila16@gmail.com>
Discussion: https://postgr.es/m/CANhcyEWbjkFvk3mSy5LFs9+0z4K1gDwQeFj7GUjOe+L4vxs4AA@mail.gmail.com
Discussion: https://postgr.es/m/CAA4eK1LC+KJiAkSrpE_NwvNdidw9F2os7GERUeSxSKv71gXysQ@mail.gmail.com
This commit is contained in:
Amit Kapila
2025-11-12 03:28:17 +00:00
parent 2421ade663
commit bfb7419b0b

View File

@@ -453,7 +453,7 @@ static Node *makeRecursiveViewSelect(char *relname, List *aliases, Node *query);
transform_element_list transform_type_list
TriggerTransitions TriggerReferencing
vacuum_relation_list opt_vacuum_relation_list
drop_option_list pub_obj_list pub_obj_type_list
drop_option_list pub_obj_list pub_all_obj_type_list
%type <retclause> returning_clause
%type <node> returning_option
@@ -10731,9 +10731,9 @@ AlterOwnerStmt: ALTER AGGREGATE aggregate_with_argtypes OWNER TO RoleSpec
*
* CREATE PUBLICATION name [WITH options]
*
* CREATE PUBLICATION FOR ALL pub_obj_type [, ...] [WITH options]
* CREATE PUBLICATION FOR ALL pub_all_obj_type [, ...] [WITH options]
*
* pub_obj_type is one of:
* pub_all_obj_type is one of:
*
* TABLES
* SEQUENCES
@@ -10756,12 +10756,11 @@ CreatePublicationStmt:
n->options = $4;
$$ = (Node *) n;
}
| CREATE PUBLICATION name FOR pub_obj_type_list opt_definition
| CREATE PUBLICATION name FOR pub_all_obj_type_list opt_definition
{
CreatePublicationStmt *n = makeNode(CreatePublicationStmt);
n->pubname = $3;
n->pubobjects = (List *) $5;
preprocess_pub_all_objtype_list($5, &n->for_all_tables,
&n->for_all_sequences,
yyscanner);
@@ -10892,9 +10891,9 @@ PublicationAllObjSpec:
}
;
pub_obj_type_list: PublicationAllObjSpec
pub_all_obj_type_list: PublicationAllObjSpec
{ $$ = list_make1($1); }
| pub_obj_type_list ',' PublicationAllObjSpec
| pub_all_obj_type_list ',' PublicationAllObjSpec
{ $$ = lappend($1, $3); }
;