@@ -286,7 +286,7 @@ static TypeName *TableFuncTypeName(List *columns);
286
286
oper_argtypes RuleActionList RuleActionMulti
287
287
opt_column_list columnList opt_name_list
288
288
sort_clause opt_sort_clause sortby_list index_params
289
- name_list from_clause from_list opt_array_bounds
289
+ name_list role_list from_clause from_list opt_array_bounds
290
290
qualified_name_list any_name any_name_list
291
291
any_operator expr_list attrs
292
292
target_list insert_column_list set_target_list
@@ -866,7 +866,7 @@ AlterOptRoleElem:
866
866
$$ = makeDefElem(" validUntil" , (Node *)makeString($3 ));
867
867
}
868
868
/* Supported but not documented for roles, for use by ALTER GROUP.*/
869
- | USER name_list
869
+ | USER role_list
870
870
{
871
871
$$ = makeDefElem(" rolemembers" , (Node *)$2 );
872
872
}
@@ -879,19 +879,19 @@ CreateOptRoleElem:
879
879
{
880
880
$$ = makeDefElem(" sysid" , (Node *)makeInteger($2 ));
881
881
}
882
- | ADMIN name_list
882
+ | ADMIN role_list
883
883
{
884
884
$$ = makeDefElem(" adminmembers" , (Node *)$2 );
885
885
}
886
- | ROLE name_list
886
+ | ROLE role_list
887
887
{
888
888
$$ = makeDefElem(" rolemembers" , (Node *)$2 );
889
889
}
890
- | IN_P ROLE name_list
890
+ | IN_P ROLE role_list
891
891
{
892
892
$$ = makeDefElem(" addroleto" , (Node *)$3 );
893
893
}
894
- | IN_P GROUP_P name_list
894
+ | IN_P GROUP_P role_list
895
895
{
896
896
$$ = makeDefElem(" addroleto" , (Node *)$3 );
897
897
}
@@ -990,14 +990,14 @@ AlterUserSetStmt:
990
990
*****************************************************************************/
991
991
992
992
DropRoleStmt :
993
- DROP ROLE name_list
993
+ DROP ROLE role_list
994
994
{
995
995
DropRoleStmt *n = makeNode(DropRoleStmt);
996
996
n->missing_ok =FALSE ;
997
997
n->roles =$3 ;
998
998
$$ = (Node *)n;
999
999
}
1000
- | DROP ROLE IF_P EXISTS name_list
1000
+ | DROP ROLE IF_P EXISTS role_list
1001
1001
{
1002
1002
DropRoleStmt *n = makeNode(DropRoleStmt);
1003
1003
n->missing_ok =TRUE ;
@@ -1016,14 +1016,14 @@ DropRoleStmt:
1016
1016
*****************************************************************************/
1017
1017
1018
1018
DropUserStmt :
1019
- DROP USER name_list
1019
+ DROP USER role_list
1020
1020
{
1021
1021
DropRoleStmt *n = makeNode(DropRoleStmt);
1022
1022
n->missing_ok =FALSE ;
1023
1023
n->roles =$3 ;
1024
1024
$$ = (Node *)n;
1025
1025
}
1026
- | DROP USER IF_P EXISTS name_list
1026
+ | DROP USER IF_P EXISTS role_list
1027
1027
{
1028
1028
DropRoleStmt *n = makeNode(DropRoleStmt);
1029
1029
n->roles =$5 ;
@@ -1058,7 +1058,7 @@ CreateGroupStmt:
1058
1058
*****************************************************************************/
1059
1059
1060
1060
AlterGroupStmt :
1061
- ALTER GROUP_P RoleId add_drop USER name_list
1061
+ ALTER GROUP_P RoleId add_drop USER role_list
1062
1062
{
1063
1063
AlterRoleStmt *n = makeNode(AlterRoleStmt);
1064
1064
n->role =$3 ;
@@ -1082,14 +1082,14 @@ add_drop:ADD_P{ $$ = +1; }
1082
1082
*****************************************************************************/
1083
1083
1084
1084
DropGroupStmt :
1085
- DROP GROUP_P name_list
1085
+ DROP GROUP_P role_list
1086
1086
{
1087
1087
DropRoleStmt *n = makeNode(DropRoleStmt);
1088
1088
n->missing_ok =FALSE ;
1089
1089
n->roles =$3 ;
1090
1090
$$ = (Node *)n;
1091
1091
}
1092
- | DROP GROUP_P IF_P EXISTS name_list
1092
+ | DROP GROUP_P IF_P EXISTS role_list
1093
1093
{
1094
1094
DropRoleStmt *n = makeNode(DropRoleStmt);
1095
1095
n->missing_ok =TRUE ;
@@ -3997,8 +3997,8 @@ DropOpFamilyStmt:
3997
3997
*
3998
3998
*****************************************************************************/
3999
3999
DropOwnedStmt:
4000
- DROP OWNED BYname_list opt_drop_behavior
4001
- {
4000
+ DROP OWNED BYrole_list opt_drop_behavior
4001
+ {
4002
4002
DropOwnedStmt *n = makeNode(DropOwnedStmt);
4003
4003
n->roles =$4 ;
4004
4004
n->behavior =$5 ;
@@ -4007,7 +4007,7 @@ DropOwnedStmt:
4007
4007
;
4008
4008
4009
4009
ReassignOwnedStmt:
4010
- REASSIGN OWNED BYname_list TO name
4010
+ REASSIGN OWNED BYrole_list TO name
4011
4011
{
4012
4012
ReassignOwnedStmt *n = makeNode(ReassignOwnedStmt);
4013
4013
n->roles =$4 ;
@@ -4748,7 +4748,7 @@ function_with_argtypes:
4748
4748
*****************************************************************************/
4749
4749
4750
4750
GrantRoleStmt:
4751
- GRANT privilege_list TOname_list opt_grant_admin_option opt_granted_by
4751
+ GRANT privilege_list TOrole_list opt_grant_admin_option opt_granted_by
4752
4752
{
4753
4753
GrantRoleStmt *n = makeNode(GrantRoleStmt);
4754
4754
n->is_grant =true ;
@@ -4761,7 +4761,7 @@ GrantRoleStmt:
4761
4761
;
4762
4762
4763
4763
RevokeRoleStmt:
4764
- REVOKE privilege_list FROMname_list opt_granted_by opt_drop_behavior
4764
+ REVOKE privilege_list FROMrole_list opt_granted_by opt_drop_behavior
4765
4765
{
4766
4766
GrantRoleStmt *n = makeNode(GrantRoleStmt);
4767
4767
n->is_grant =false ;
@@ -4771,7 +4771,7 @@ RevokeRoleStmt:
4771
4771
n->behavior =$6 ;
4772
4772
$$ = (Node*)n;
4773
4773
}
4774
- | REVOKE ADMIN OPTION FOR privilege_list FROMname_list opt_granted_by opt_drop_behavior
4774
+ | REVOKE ADMIN OPTION FOR privilege_list FROMrole_list opt_granted_by opt_drop_behavior
4775
4775
{
4776
4776
GrantRoleStmt *n = makeNode(GrantRoleStmt);
4777
4777
n->is_grant =false ;
@@ -4817,11 +4817,11 @@ DefACLOption:
4817
4817
{
4818
4818
$$ = makeDefElem(" schemas" , (Node *)$3 );
4819
4819
}
4820
- | FOR ROLEname_list
4820
+ | FOR ROLErole_list
4821
4821
{
4822
4822
$$ = makeDefElem(" roles" , (Node *)$3 );
4823
4823
}
4824
- | FOR USERname_list
4824
+ | FOR USERrole_list
4825
4825
{
4826
4826
$$ = makeDefElem(" roles" , (Node *)$3 );
4827
4827
}
@@ -10778,6 +10778,12 @@ Iconst:ICONST{ $$ = $1; };
10778
10778
Sconst:SCONST{ $$ = $1 ; };
10779
10779
RoleId:NonReservedWord{ $$ = $1 ; };
10780
10780
10781
+ role_list:RoleId
10782
+ { $$ =list_make1 (makeString ($1 )); }
10783
+ | role_list' ,' RoleId
10784
+ { $$ =lappend ($1 ,makeString ($3 )); }
10785
+ ;
10786
+
10781
10787
SignedIconst: Iconst{ $$ = $1 ; }
10782
10788
|' +' Iconst{ $$ = + $2 ; }
10783
10789
|' -' Iconst{ $$ = - $2 ; }