@@ -329,7 +329,7 @@ static Node *makeRecursiveViewSelect(char *relname, List *aliases, Node *query);
329
329
oper_argtypes RuleActionList RuleActionMulti
330
330
opt_column_list columnList opt_name_list
331
331
sort_clause opt_sort_clause sortby_list index_params
332
- name_list from_clause from_list opt_array_bounds
332
+ name_list role_list from_clause from_list opt_array_bounds
333
333
qualified_name_list any_name any_name_list
334
334
any_operator expr_list attrs
335
335
target_list insert_column_list set_target_list
@@ -889,7 +889,7 @@ AlterOptRoleElem:
889
889
$$ = makeDefElem(" validUntil" , (Node *)makeString($3 ));
890
890
}
891
891
/* Supported but not documented for roles, for use by ALTER GROUP.*/
892
- | USER name_list
892
+ | USER role_list
893
893
{
894
894
$$ = makeDefElem(" rolemembers" , (Node *)$2 );
895
895
}
@@ -953,19 +953,19 @@ CreateOptRoleElem:
953
953
{
954
954
$$ = makeDefElem(" sysid" , (Node *)makeInteger($2 ));
955
955
}
956
- | ADMIN name_list
956
+ | ADMIN role_list
957
957
{
958
958
$$ = makeDefElem(" adminmembers" , (Node *)$2 );
959
959
}
960
- | ROLE name_list
960
+ | ROLE role_list
961
961
{
962
962
$$ = makeDefElem(" rolemembers" , (Node *)$2 );
963
963
}
964
- | IN_P ROLE name_list
964
+ | IN_P ROLE role_list
965
965
{
966
966
$$ = makeDefElem(" addroleto" , (Node *)$3 );
967
967
}
968
- | IN_P GROUP_P name_list
968
+ | IN_P GROUP_P role_list
969
969
{
970
970
$$ = makeDefElem(" addroleto" , (Node *)$3 );
971
971
}
@@ -1072,14 +1072,14 @@ AlterUserSetStmt:
1072
1072
*****************************************************************************/
1073
1073
1074
1074
DropRoleStmt :
1075
- DROP ROLE name_list
1075
+ DROP ROLE role_list
1076
1076
{
1077
1077
DropRoleStmt *n = makeNode(DropRoleStmt);
1078
1078
n->missing_ok =FALSE ;
1079
1079
n->roles =$3 ;
1080
1080
$$ = (Node *)n;
1081
1081
}
1082
- | DROP ROLE IF_P EXISTS name_list
1082
+ | DROP ROLE IF_P EXISTS role_list
1083
1083
{
1084
1084
DropRoleStmt *n = makeNode(DropRoleStmt);
1085
1085
n->missing_ok =TRUE ;
@@ -1098,14 +1098,14 @@ DropRoleStmt:
1098
1098
*****************************************************************************/
1099
1099
1100
1100
DropUserStmt :
1101
- DROP USER name_list
1101
+ DROP USER role_list
1102
1102
{
1103
1103
DropRoleStmt *n = makeNode(DropRoleStmt);
1104
1104
n->missing_ok =FALSE ;
1105
1105
n->roles =$3 ;
1106
1106
$$ = (Node *)n;
1107
1107
}
1108
- | DROP USER IF_P EXISTS name_list
1108
+ | DROP USER IF_P EXISTS role_list
1109
1109
{
1110
1110
DropRoleStmt *n = makeNode(DropRoleStmt);
1111
1111
n->roles =$5 ;
@@ -1140,7 +1140,7 @@ CreateGroupStmt:
1140
1140
*****************************************************************************/
1141
1141
1142
1142
AlterGroupStmt :
1143
- ALTER GROUP_P RoleId add_drop USER name_list
1143
+ ALTER GROUP_P RoleId add_drop USER role_list
1144
1144
{
1145
1145
AlterRoleStmt *n = makeNode(AlterRoleStmt);
1146
1146
n->role =$3 ;
@@ -1164,14 +1164,14 @@ add_drop:ADD_P{ $$ = +1; }
1164
1164
*****************************************************************************/
1165
1165
1166
1166
DropGroupStmt :
1167
- DROP GROUP_P name_list
1167
+ DROP GROUP_P role_list
1168
1168
{
1169
1169
DropRoleStmt *n = makeNode(DropRoleStmt);
1170
1170
n->missing_ok =FALSE ;
1171
1171
n->roles =$3 ;
1172
1172
$$ = (Node *)n;
1173
1173
}
1174
- | DROP GROUP_P IF_P EXISTS name_list
1174
+ | DROP GROUP_P IF_P EXISTS role_list
1175
1175
{
1176
1176
DropRoleStmt *n = makeNode(DropRoleStmt);
1177
1177
n->missing_ok =TRUE ;
@@ -5047,7 +5047,7 @@ DropOpFamilyStmt:
5047
5047
*
5048
5048
*****************************************************************************/
5049
5049
DropOwnedStmt :
5050
- DROP OWNED BY name_list opt_drop_behavior
5050
+ DROP OWNED BY role_list opt_drop_behavior
5051
5051
{
5052
5052
DropOwnedStmt *n = makeNode(DropOwnedStmt);
5053
5053
n->roles =$4 ;
@@ -5057,7 +5057,7 @@ DropOwnedStmt:
5057
5057
;
5058
5058
5059
5059
ReassignOwnedStmt :
5060
- REASSIGN OWNED BY name_list TO name
5060
+ REASSIGN OWNED BY role_list TO name
5061
5061
{
5062
5062
ReassignOwnedStmt *n = makeNode(ReassignOwnedStmt);
5063
5063
n->roles =$4 ;
@@ -5923,7 +5923,7 @@ function_with_argtypes:
5923
5923
*****************************************************************************/
5924
5924
5925
5925
GrantRoleStmt :
5926
- GRANT privilege_list TO name_list opt_grant_admin_option opt_granted_by
5926
+ GRANT privilege_list TO role_list opt_grant_admin_option opt_granted_by
5927
5927
{
5928
5928
GrantRoleStmt *n = makeNode(GrantRoleStmt);
5929
5929
n->is_grant =true ;
@@ -5936,7 +5936,7 @@ GrantRoleStmt:
5936
5936
;
5937
5937
5938
5938
RevokeRoleStmt :
5939
- REVOKE privilege_list FROM name_list opt_granted_by opt_drop_behavior
5939
+ REVOKE privilege_list FROM role_list opt_granted_by opt_drop_behavior
5940
5940
{
5941
5941
GrantRoleStmt *n = makeNode(GrantRoleStmt);
5942
5942
n->is_grant =false ;
@@ -5946,7 +5946,7 @@ RevokeRoleStmt:
5946
5946
n->behavior =$6 ;
5947
5947
$$ = (Node*)n;
5948
5948
}
5949
- | REVOKE ADMIN OPTION FOR privilege_list FROM name_list opt_granted_by opt_drop_behavior
5949
+ | REVOKE ADMIN OPTION FOR privilege_list FROM role_list opt_granted_by opt_drop_behavior
5950
5950
{
5951
5951
GrantRoleStmt *n = makeNode(GrantRoleStmt);
5952
5952
n->is_grant =false ;
@@ -5992,11 +5992,11 @@ DefACLOption:
5992
5992
{
5993
5993
$$ = makeDefElem(" schemas" , (Node *)$3 );
5994
5994
}
5995
- | FOR ROLE name_list
5995
+ | FOR ROLE role_list
5996
5996
{
5997
5997
$$ = makeDefElem(" roles" , (Node *)$3 );
5998
5998
}
5999
- | FOR USER name_list
5999
+ | FOR USER role_list
6000
6000
{
6001
6001
$$ = makeDefElem(" roles" , (Node *)$3 );
6002
6002
}
@@ -12587,6 +12587,12 @@ Iconst:ICONST{ $$ = $1; };
12587
12587
Sconst:SCONST{ $$ = $1 ; };
12588
12588
RoleId:NonReservedWord{ $$ = $1 ; };
12589
12589
12590
+ role_list:RoleId
12591
+ { $$ =list_make1 (makeString ($1 )); }
12592
+ | role_list' ,' RoleId
12593
+ { $$ =lappend ($1 ,makeString ($3 )); }
12594
+ ;
12595
+
12590
12596
SignedIconst: Iconst{ $$ = $1 ; }
12591
12597
|' +' Iconst{ $$ = + $2 ; }
12592
12598
|' -' Iconst{ $$ = - $2 ; }