@@ -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
@@ -860,7 +860,7 @@ AlterOptRoleElem:
860
860
$$ = makeDefElem(" validUntil" , (Node *)makeString($3 ));
861
861
}
862
862
/* Supported but not documented for roles, for use by ALTER GROUP. */
863
- | USER name_list
863
+ | USER role_list
864
864
{
865
865
$$ = makeDefElem(" rolemembers" , (Node *)$2 );
866
866
}
@@ -924,19 +924,19 @@ CreateOptRoleElem:
924
924
{
925
925
$$ = makeDefElem(" sysid" , (Node *)makeInteger($2 ));
926
926
}
927
- | ADMIN name_list
927
+ | ADMIN role_list
928
928
{
929
929
$$ = makeDefElem(" adminmembers" , (Node *)$2 );
930
930
}
931
- | ROLE name_list
931
+ | ROLE role_list
932
932
{
933
933
$$ = makeDefElem(" rolemembers" , (Node *)$2 );
934
934
}
935
- | IN_P ROLE name_list
935
+ | IN_P ROLE role_list
936
936
{
937
937
$$ = makeDefElem(" addroleto" , (Node *)$3 );
938
938
}
939
- | IN_P GROUP_P name_list
939
+ | IN_P GROUP_P role_list
940
940
{
941
941
$$ = makeDefElem(" addroleto" , (Node *)$3 );
942
942
}
@@ -1035,14 +1035,14 @@ AlterUserSetStmt:
1035
1035
*****************************************************************************/
1036
1036
1037
1037
DropRoleStmt :
1038
- DROP ROLE name_list
1038
+ DROP ROLE role_list
1039
1039
{
1040
1040
DropRoleStmt *n = makeNode(DropRoleStmt);
1041
1041
n->missing_ok = FALSE ;
1042
1042
n->roles = $3 ;
1043
1043
$$ = (Node *)n;
1044
1044
}
1045
- | DROP ROLE IF_P EXISTS name_list
1045
+ | DROP ROLE IF_P EXISTS role_list
1046
1046
{
1047
1047
DropRoleStmt *n = makeNode(DropRoleStmt);
1048
1048
n->missing_ok = TRUE ;
@@ -1061,14 +1061,14 @@ DropRoleStmt:
1061
1061
*****************************************************************************/
1062
1062
1063
1063
DropUserStmt :
1064
- DROP USER name_list
1064
+ DROP USER role_list
1065
1065
{
1066
1066
DropRoleStmt *n = makeNode(DropRoleStmt);
1067
1067
n->missing_ok = FALSE ;
1068
1068
n->roles = $3 ;
1069
1069
$$ = (Node *)n;
1070
1070
}
1071
- | DROP USER IF_P EXISTS name_list
1071
+ | DROP USER IF_P EXISTS role_list
1072
1072
{
1073
1073
DropRoleStmt *n = makeNode(DropRoleStmt);
1074
1074
n->roles = $5 ;
@@ -1103,7 +1103,7 @@ CreateGroupStmt:
1103
1103
*****************************************************************************/
1104
1104
1105
1105
AlterGroupStmt :
1106
- ALTER GROUP_P RoleId add_drop USER name_list
1106
+ ALTER GROUP_P RoleId add_drop USER role_list
1107
1107
{
1108
1108
AlterRoleStmt *n = makeNode(AlterRoleStmt);
1109
1109
n->role = $3 ;
@@ -1127,14 +1127,14 @@ add_drop: ADD_P { $$ = +1; }
1127
1127
*****************************************************************************/
1128
1128
1129
1129
DropGroupStmt :
1130
- DROP GROUP_P name_list
1130
+ DROP GROUP_P role_list
1131
1131
{
1132
1132
DropRoleStmt *n = makeNode(DropRoleStmt);
1133
1133
n->missing_ok = FALSE ;
1134
1134
n->roles = $3 ;
1135
1135
$$ = (Node *)n;
1136
1136
}
1137
- | DROP GROUP_P IF_P EXISTS name_list
1137
+ | DROP GROUP_P IF_P EXISTS role_list
1138
1138
{
1139
1139
DropRoleStmt *n = makeNode(DropRoleStmt);
1140
1140
n->missing_ok = TRUE ;
@@ -4790,7 +4790,7 @@ DropOpFamilyStmt:
4790
4790
*
4791
4791
*****************************************************************************/
4792
4792
DropOwnedStmt :
4793
- DROP OWNED BY name_list opt_drop_behavior
4793
+ DROP OWNED BY role_list opt_drop_behavior
4794
4794
{
4795
4795
DropOwnedStmt *n = makeNode(DropOwnedStmt);
4796
4796
n->roles = $4 ;
@@ -4800,7 +4800,7 @@ DropOwnedStmt:
4800
4800
;
4801
4801
4802
4802
ReassignOwnedStmt :
4803
- REASSIGN OWNED BY name_list TO name
4803
+ REASSIGN OWNED BY role_list TO name
4804
4804
{
4805
4805
ReassignOwnedStmt *n = makeNode(ReassignOwnedStmt);
4806
4806
n->roles = $4 ;
@@ -5682,7 +5682,7 @@ function_with_argtypes:
5682
5682
*****************************************************************************/
5683
5683
5684
5684
GrantRoleStmt :
5685
- GRANT privilege_list TO name_list opt_grant_admin_option opt_granted_by
5685
+ GRANT privilege_list TO role_list opt_grant_admin_option opt_granted_by
5686
5686
{
5687
5687
GrantRoleStmt *n = makeNode(GrantRoleStmt);
5688
5688
n->is_grant = true ;
@@ -5695,7 +5695,7 @@ GrantRoleStmt:
5695
5695
;
5696
5696
5697
5697
RevokeRoleStmt :
5698
- REVOKE privilege_list FROM name_list opt_granted_by opt_drop_behavior
5698
+ REVOKE privilege_list FROM role_list opt_granted_by opt_drop_behavior
5699
5699
{
5700
5700
GrantRoleStmt *n = makeNode(GrantRoleStmt);
5701
5701
n->is_grant = false ;
@@ -5705,7 +5705,7 @@ RevokeRoleStmt:
5705
5705
n->behavior = $6 ;
5706
5706
$$ = (Node*)n;
5707
5707
}
5708
- | REVOKE ADMIN OPTION FOR privilege_list FROM name_list opt_granted_by opt_drop_behavior
5708
+ | REVOKE ADMIN OPTION FOR privilege_list FROM role_list opt_granted_by opt_drop_behavior
5709
5709
{
5710
5710
GrantRoleStmt *n = makeNode(GrantRoleStmt);
5711
5711
n->is_grant = false ;
@@ -5751,11 +5751,11 @@ DefACLOption:
5751
5751
{
5752
5752
$$ = makeDefElem(" schemas" , (Node *)$3 );
5753
5753
}
5754
- | FOR ROLE name_list
5754
+ | FOR ROLE role_list
5755
5755
{
5756
5756
$$ = makeDefElem(" roles" , (Node *)$3 );
5757
5757
}
5758
- | FOR USER name_list
5758
+ | FOR USER role_list
5759
5759
{
5760
5760
$$ = makeDefElem(" roles" , (Node *)$3 );
5761
5761
}
@@ -12204,6 +12204,12 @@ Iconst: ICONST { $$ = $1; };
12204
12204
Sconst: SCONST { $$ = $1 ; };
12205
12205
RoleId: NonReservedWord { $$ = $1 ; };
12206
12206
12207
+ role_list: RoleId
12208
+ { $$ = list_make1 (makeString ($1 )); }
12209
+ | role_list ' ,' RoleId
12210
+ { $$ = lappend ($1 , makeString ($3 )); }
12211
+ ;
12212
+
12207
12213
SignedIconst: Iconst { $$ = $1 ; }
12208
12214
| ' +' Iconst { $$ = + $2 ; }
12209
12215
| ' -' Iconst { $$ = - $2 ; }
0 commit comments