@@ -306,7 +306,7 @@ static void processCASbits(int cas_bits, int location, const char *constrType,
306
306
oper_argtypes RuleActionList RuleActionMulti
307
307
opt_column_list columnList opt_name_list
308
308
sort_clause opt_sort_clause sortby_list index_params
309
- name_list from_clause from_list opt_array_bounds
309
+ name_list role_list from_clause from_list opt_array_bounds
310
310
qualified_name_list any_name any_name_list
311
311
any_operator expr_list attrs
312
312
target_list insert_column_list set_target_list
@@ -861,7 +861,7 @@ AlterOptRoleElem:
861
861
$$ = makeDefElem(" validUntil" , (Node *)makeString($3 ));
862
862
}
863
863
/* Supported but not documented for roles, for use by ALTER GROUP. */
864
- | USER name_list
864
+ | USER role_list
865
865
{
866
866
$$ = makeDefElem(" rolemembers" , (Node *)$2 );
867
867
}
@@ -925,19 +925,19 @@ CreateOptRoleElem:
925
925
{
926
926
$$ = makeDefElem(" sysid" , (Node *)makeInteger($2 ));
927
927
}
928
- | ADMIN name_list
928
+ | ADMIN role_list
929
929
{
930
930
$$ = makeDefElem(" adminmembers" , (Node *)$2 );
931
931
}
932
- | ROLE name_list
932
+ | ROLE role_list
933
933
{
934
934
$$ = makeDefElem(" rolemembers" , (Node *)$2 );
935
935
}
936
- | IN_P ROLE name_list
936
+ | IN_P ROLE role_list
937
937
{
938
938
$$ = makeDefElem(" addroleto" , (Node *)$3 );
939
939
}
940
- | IN_P GROUP_P name_list
940
+ | IN_P GROUP_P role_list
941
941
{
942
942
$$ = makeDefElem(" addroleto" , (Node *)$3 );
943
943
}
@@ -1036,14 +1036,14 @@ AlterUserSetStmt:
1036
1036
*****************************************************************************/
1037
1037
1038
1038
DropRoleStmt :
1039
- DROP ROLE name_list
1039
+ DROP ROLE role_list
1040
1040
{
1041
1041
DropRoleStmt *n = makeNode(DropRoleStmt);
1042
1042
n->missing_ok = FALSE ;
1043
1043
n->roles = $3 ;
1044
1044
$$ = (Node *)n;
1045
1045
}
1046
- | DROP ROLE IF_P EXISTS name_list
1046
+ | DROP ROLE IF_P EXISTS role_list
1047
1047
{
1048
1048
DropRoleStmt *n = makeNode(DropRoleStmt);
1049
1049
n->missing_ok = TRUE ;
@@ -1062,14 +1062,14 @@ DropRoleStmt:
1062
1062
*****************************************************************************/
1063
1063
1064
1064
DropUserStmt :
1065
- DROP USER name_list
1065
+ DROP USER role_list
1066
1066
{
1067
1067
DropRoleStmt *n = makeNode(DropRoleStmt);
1068
1068
n->missing_ok = FALSE ;
1069
1069
n->roles = $3 ;
1070
1070
$$ = (Node *)n;
1071
1071
}
1072
- | DROP USER IF_P EXISTS name_list
1072
+ | DROP USER IF_P EXISTS role_list
1073
1073
{
1074
1074
DropRoleStmt *n = makeNode(DropRoleStmt);
1075
1075
n->roles = $5 ;
@@ -1104,7 +1104,7 @@ CreateGroupStmt:
1104
1104
*****************************************************************************/
1105
1105
1106
1106
AlterGroupStmt :
1107
- ALTER GROUP_P RoleId add_drop USER name_list
1107
+ ALTER GROUP_P RoleId add_drop USER role_list
1108
1108
{
1109
1109
AlterRoleStmt *n = makeNode(AlterRoleStmt);
1110
1110
n->role = $3 ;
@@ -1128,14 +1128,14 @@ add_drop: ADD_P { $$ = +1; }
1128
1128
*****************************************************************************/
1129
1129
1130
1130
DropGroupStmt :
1131
- DROP GROUP_P name_list
1131
+ DROP GROUP_P role_list
1132
1132
{
1133
1133
DropRoleStmt *n = makeNode(DropRoleStmt);
1134
1134
n->missing_ok = FALSE ;
1135
1135
n->roles = $3 ;
1136
1136
$$ = (Node *)n;
1137
1137
}
1138
- | DROP GROUP_P IF_P EXISTS name_list
1138
+ | DROP GROUP_P IF_P EXISTS role_list
1139
1139
{
1140
1140
DropRoleStmt *n = makeNode(DropRoleStmt);
1141
1141
n->missing_ok = TRUE ;
@@ -4688,8 +4688,8 @@ DropOpFamilyStmt:
4688
4688
*
4689
4689
*****************************************************************************/
4690
4690
DropOwnedStmt :
4691
- DROP OWNED BY name_list opt_drop_behavior
4692
- {
4691
+ DROP OWNED BY role_list opt_drop_behavior
4692
+ {
4693
4693
DropOwnedStmt *n = makeNode(DropOwnedStmt);
4694
4694
n->roles = $4 ;
4695
4695
n->behavior = $5 ;
@@ -4698,7 +4698,7 @@ DropOwnedStmt:
4698
4698
;
4699
4699
4700
4700
ReassignOwnedStmt :
4701
- REASSIGN OWNED BY name_list TO name
4701
+ REASSIGN OWNED BY role_list TO name
4702
4702
{
4703
4703
ReassignOwnedStmt *n = makeNode(ReassignOwnedStmt);
4704
4704
n->roles = $4 ;
@@ -5535,7 +5535,7 @@ function_with_argtypes:
5535
5535
*****************************************************************************/
5536
5536
5537
5537
GrantRoleStmt :
5538
- GRANT privilege_list TO name_list opt_grant_admin_option opt_granted_by
5538
+ GRANT privilege_list TO role_list opt_grant_admin_option opt_granted_by
5539
5539
{
5540
5540
GrantRoleStmt *n = makeNode(GrantRoleStmt);
5541
5541
n->is_grant = true ;
@@ -5548,7 +5548,7 @@ GrantRoleStmt:
5548
5548
;
5549
5549
5550
5550
RevokeRoleStmt :
5551
- REVOKE privilege_list FROM name_list opt_granted_by opt_drop_behavior
5551
+ REVOKE privilege_list FROM role_list opt_granted_by opt_drop_behavior
5552
5552
{
5553
5553
GrantRoleStmt *n = makeNode(GrantRoleStmt);
5554
5554
n->is_grant = false ;
@@ -5558,7 +5558,7 @@ RevokeRoleStmt:
5558
5558
n->behavior = $6 ;
5559
5559
$$ = (Node*)n;
5560
5560
}
5561
- | REVOKE ADMIN OPTION FOR privilege_list FROM name_list opt_granted_by opt_drop_behavior
5561
+ | REVOKE ADMIN OPTION FOR privilege_list FROM role_list opt_granted_by opt_drop_behavior
5562
5562
{
5563
5563
GrantRoleStmt *n = makeNode(GrantRoleStmt);
5564
5564
n->is_grant = false ;
@@ -5604,11 +5604,11 @@ DefACLOption:
5604
5604
{
5605
5605
$$ = makeDefElem(" schemas" , (Node *)$3 );
5606
5606
}
5607
- | FOR ROLE name_list
5607
+ | FOR ROLE role_list
5608
5608
{
5609
5609
$$ = makeDefElem(" roles" , (Node *)$3 );
5610
5610
}
5611
- | FOR USER name_list
5611
+ | FOR USER role_list
5612
5612
{
5613
5613
$$ = makeDefElem(" roles" , (Node *)$3 );
5614
5614
}
@@ -11783,6 +11783,12 @@ Iconst: ICONST { $$ = $1; };
11783
11783
Sconst: SCONST { $$ = $1 ; };
11784
11784
RoleId: NonReservedWord { $$ = $1 ; };
11785
11785
11786
+ role_list: RoleId
11787
+ { $$ = list_make1 (makeString ($1 )); }
11788
+ | role_list ' ,' RoleId
11789
+ { $$ = lappend ($1 , makeString ($3 )); }
11790
+ ;
11791
+
11786
11792
SignedIconst: Iconst { $$ = $1 ; }
11787
11793
| ' +' Iconst { $$ = + $2 ; }
11788
11794
| ' -' Iconst { $$ = - $2 ; }
0 commit comments