@@ -334,7 +334,7 @@ static Node *makeRecursiveViewSelect(char *relname, List *aliases, Node *query);
334334 oper_argtypes RuleActionList RuleActionMulti
335335 opt_column_list columnList opt_name_list
336336 sort_clause opt_sort_clause sortby_list index_params
337- name_list from_clause from_list opt_array_bounds
337+ name_list role_list from_clause from_list opt_array_bounds
338338 qualified_name_list any_name any_name_list
339339 any_operator expr_list attrs
340340 target_list opt_target_list insert_column_list set_target_list
@@ -901,7 +901,7 @@ AlterOptRoleElem:
901901 $$ = makeDefElem(" validUntil" , (Node *)makeString($3 ));
902902 }
903903 /* Supported but not documented for roles, for use by ALTER GROUP. */
904- | USER name_list
904+ | USER role_list
905905 {
906906 $$ = makeDefElem(" rolemembers" , (Node *)$2 );
907907 }
@@ -965,19 +965,19 @@ CreateOptRoleElem:
965965 {
966966 $$ = makeDefElem(" sysid" , (Node *)makeInteger($2 ));
967967 }
968- | ADMIN name_list
968+ | ADMIN role_list
969969 {
970970 $$ = makeDefElem(" adminmembers" , (Node *)$2 );
971971 }
972- | ROLE name_list
972+ | ROLE role_list
973973 {
974974 $$ = makeDefElem(" rolemembers" , (Node *)$2 );
975975 }
976- | IN_P ROLE name_list
976+ | IN_P ROLE role_list
977977 {
978978 $$ = makeDefElem(" addroleto" , (Node *)$3 );
979979 }
980- | IN_P GROUP_P name_list
980+ | IN_P GROUP_P role_list
981981 {
982982 $$ = makeDefElem(" addroleto" , (Node *)$3 );
983983 }
@@ -1084,14 +1084,14 @@ AlterUserSetStmt:
10841084 *****************************************************************************/
10851085
10861086DropRoleStmt :
1087- DROP ROLE name_list
1087+ DROP ROLE role_list
10881088 {
10891089 DropRoleStmt *n = makeNode(DropRoleStmt);
10901090 n->missing_ok = FALSE ;
10911091 n->roles = $3 ;
10921092 $$ = (Node *)n;
10931093 }
1094- | DROP ROLE IF_P EXISTS name_list
1094+ | DROP ROLE IF_P EXISTS role_list
10951095 {
10961096 DropRoleStmt *n = makeNode(DropRoleStmt);
10971097 n->missing_ok = TRUE ;
@@ -1110,14 +1110,14 @@ DropRoleStmt:
11101110 *****************************************************************************/
11111111
11121112DropUserStmt :
1113- DROP USER name_list
1113+ DROP USER role_list
11141114 {
11151115 DropRoleStmt *n = makeNode(DropRoleStmt);
11161116 n->missing_ok = FALSE ;
11171117 n->roles = $3 ;
11181118 $$ = (Node *)n;
11191119 }
1120- | DROP USER IF_P EXISTS name_list
1120+ | DROP USER IF_P EXISTS role_list
11211121 {
11221122 DropRoleStmt *n = makeNode(DropRoleStmt);
11231123 n->roles = $5 ;
@@ -1152,7 +1152,7 @@ CreateGroupStmt:
11521152 *****************************************************************************/
11531153
11541154AlterGroupStmt :
1155- ALTER GROUP_P RoleId add_drop USER name_list
1155+ ALTER GROUP_P RoleId add_drop USER role_list
11561156 {
11571157 AlterRoleStmt *n = makeNode(AlterRoleStmt);
11581158 n->role = $3 ;
@@ -1176,14 +1176,14 @@ add_drop: ADD_P { $$ = +1; }
11761176 *****************************************************************************/
11771177
11781178DropGroupStmt :
1179- DROP GROUP_P name_list
1179+ DROP GROUP_P role_list
11801180 {
11811181 DropRoleStmt *n = makeNode(DropRoleStmt);
11821182 n->missing_ok = FALSE ;
11831183 n->roles = $3 ;
11841184 $$ = (Node *)n;
11851185 }
1186- | DROP GROUP_P IF_P EXISTS name_list
1186+ | DROP GROUP_P IF_P EXISTS role_list
11871187 {
11881188 DropRoleStmt *n = makeNode(DropRoleStmt);
11891189 n->missing_ok = TRUE ;
@@ -5122,7 +5122,7 @@ DropOpFamilyStmt:
51225122 *
51235123 *****************************************************************************/
51245124DropOwnedStmt :
5125- DROP OWNED BY name_list opt_drop_behavior
5125+ DROP OWNED BY role_list opt_drop_behavior
51265126 {
51275127 DropOwnedStmt *n = makeNode(DropOwnedStmt);
51285128 n->roles = $4 ;
@@ -5132,7 +5132,7 @@ DropOwnedStmt:
51325132 ;
51335133
51345134ReassignOwnedStmt :
5135- REASSIGN OWNED BY name_list TO name
5135+ REASSIGN OWNED BY role_list TO name
51365136 {
51375137 ReassignOwnedStmt *n = makeNode(ReassignOwnedStmt);
51385138 n->roles = $4 ;
@@ -5998,7 +5998,7 @@ function_with_argtypes:
59985998 *****************************************************************************/
59995999
60006000GrantRoleStmt :
6001- GRANT privilege_list TO name_list opt_grant_admin_option opt_granted_by
6001+ GRANT privilege_list TO role_list opt_grant_admin_option opt_granted_by
60026002 {
60036003 GrantRoleStmt *n = makeNode(GrantRoleStmt);
60046004 n->is_grant = true ;
@@ -6011,7 +6011,7 @@ GrantRoleStmt:
60116011 ;
60126012
60136013RevokeRoleStmt :
6014- REVOKE privilege_list FROM name_list opt_granted_by opt_drop_behavior
6014+ REVOKE privilege_list FROM role_list opt_granted_by opt_drop_behavior
60156015 {
60166016 GrantRoleStmt *n = makeNode(GrantRoleStmt);
60176017 n->is_grant = false ;
@@ -6021,7 +6021,7 @@ RevokeRoleStmt:
60216021 n->behavior = $6 ;
60226022 $$ = (Node*)n;
60236023 }
6024- | REVOKE ADMIN OPTION FOR privilege_list FROM name_list opt_granted_by opt_drop_behavior
6024+ | REVOKE ADMIN OPTION FOR privilege_list FROM role_list opt_granted_by opt_drop_behavior
60256025 {
60266026 GrantRoleStmt *n = makeNode(GrantRoleStmt);
60276027 n->is_grant = false ;
@@ -6067,11 +6067,11 @@ DefACLOption:
60676067 {
60686068 $$ = makeDefElem(" schemas" , (Node *)$3 );
60696069 }
6070- | FOR ROLE name_list
6070+ | FOR ROLE role_list
60716071 {
60726072 $$ = makeDefElem(" roles" , (Node *)$3 );
60736073 }
6074- | FOR USER name_list
6074+ | FOR USER role_list
60756075 {
60766076 $$ = makeDefElem(" roles" , (Node *)$3 );
60776077 }
@@ -12624,6 +12624,12 @@ Iconst: ICONST { $$ = $1; };
1262412624Sconst: SCONST { $$ = $1 ; };
1262512625RoleId: NonReservedWord { $$ = $1 ; };
1262612626
12627+ role_list: RoleId
12628+ { $$ = list_make1 (makeString ($1 )); }
12629+ | role_list ' ,' RoleId
12630+ { $$ = lappend ($1 , makeString ($3 )); }
12631+ ;
12632+
1262712633SignedIconst: Iconst { $$ = $1 ; }
1262812634 | ' +' Iconst { $$ = + $2 ; }
1262912635 | ' -' Iconst { $$ = - $2 ; }
0 commit comments