@@ -306,7 +306,7 @@ static void processCASbits(int cas_bits, int location, const char *constrType,
306306oper_argtypes RuleActionList RuleActionMulti
307307opt_column_list columnList opt_name_list
308308sort_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
310310qualified_name_list any_name any_name_list
311311any_operator expr_list attrs
312312target_list insert_column_list set_target_list
@@ -860,7 +860,7 @@ AlterOptRoleElem:
860860$$ = makeDefElem(" validUntil" , (Node *)makeString($3 ));
861861}
862862/* Supported but not documented for roles, for use by ALTER GROUP.*/
863- | USER name_list
863+ | USER role_list
864864{
865865$$ = makeDefElem(" rolemembers" , (Node *)$2 );
866866}
@@ -924,19 +924,19 @@ CreateOptRoleElem:
924924{
925925$$ = makeDefElem(" sysid" , (Node *)makeInteger($2 ));
926926}
927- | ADMIN name_list
927+ | ADMIN role_list
928928{
929929$$ = makeDefElem(" adminmembers" , (Node *)$2 );
930930}
931- | ROLE name_list
931+ | ROLE role_list
932932{
933933$$ = makeDefElem(" rolemembers" , (Node *)$2 );
934934}
935- | IN_P ROLE name_list
935+ | IN_P ROLE role_list
936936{
937937$$ = makeDefElem(" addroleto" , (Node *)$3 );
938938}
939- | IN_P GROUP_P name_list
939+ | IN_P GROUP_P role_list
940940{
941941$$ = makeDefElem(" addroleto" , (Node *)$3 );
942942}
@@ -1035,14 +1035,14 @@ AlterUserSetStmt:
10351035 *****************************************************************************/
10361036
10371037DropRoleStmt :
1038- DROP ROLE name_list
1038+ DROP ROLE role_list
10391039{
10401040DropRoleStmt *n = makeNode(DropRoleStmt);
10411041n->missing_ok =FALSE ;
10421042n->roles =$3 ;
10431043$$ = (Node *)n;
10441044}
1045- | DROP ROLE IF_P EXISTS name_list
1045+ | DROP ROLE IF_P EXISTS role_list
10461046{
10471047DropRoleStmt *n = makeNode(DropRoleStmt);
10481048n->missing_ok =TRUE ;
@@ -1061,14 +1061,14 @@ DropRoleStmt:
10611061 *****************************************************************************/
10621062
10631063DropUserStmt :
1064- DROP USER name_list
1064+ DROP USER role_list
10651065{
10661066DropRoleStmt *n = makeNode(DropRoleStmt);
10671067n->missing_ok =FALSE ;
10681068n->roles =$3 ;
10691069$$ = (Node *)n;
10701070}
1071- | DROP USER IF_P EXISTS name_list
1071+ | DROP USER IF_P EXISTS role_list
10721072{
10731073DropRoleStmt *n = makeNode(DropRoleStmt);
10741074n->roles =$5 ;
@@ -1103,7 +1103,7 @@ CreateGroupStmt:
11031103 *****************************************************************************/
11041104
11051105AlterGroupStmt :
1106- ALTER GROUP_P RoleId add_drop USER name_list
1106+ ALTER GROUP_P RoleId add_drop USER role_list
11071107{
11081108AlterRoleStmt *n = makeNode(AlterRoleStmt);
11091109n->role =$3 ;
@@ -1127,14 +1127,14 @@ add_drop:ADD_P{ $$ = +1; }
11271127 *****************************************************************************/
11281128
11291129DropGroupStmt :
1130- DROP GROUP_P name_list
1130+ DROP GROUP_P role_list
11311131{
11321132DropRoleStmt *n = makeNode(DropRoleStmt);
11331133n->missing_ok =FALSE ;
11341134n->roles =$3 ;
11351135$$ = (Node *)n;
11361136}
1137- | DROP GROUP_P IF_P EXISTS name_list
1137+ | DROP GROUP_P IF_P EXISTS role_list
11381138{
11391139DropRoleStmt *n = makeNode(DropRoleStmt);
11401140n->missing_ok =TRUE ;
@@ -4790,7 +4790,7 @@ DropOpFamilyStmt:
47904790 *
47914791 *****************************************************************************/
47924792DropOwnedStmt :
4793- DROP OWNED BY name_list opt_drop_behavior
4793+ DROP OWNED BY role_list opt_drop_behavior
47944794{
47954795DropOwnedStmt *n = makeNode(DropOwnedStmt);
47964796n->roles =$4 ;
@@ -4800,7 +4800,7 @@ DropOwnedStmt:
48004800;
48014801
48024802ReassignOwnedStmt :
4803- REASSIGN OWNED BY name_list TO name
4803+ REASSIGN OWNED BY role_list TO name
48044804{
48054805ReassignOwnedStmt *n = makeNode(ReassignOwnedStmt);
48064806n->roles =$4 ;
@@ -5682,7 +5682,7 @@ function_with_argtypes:
56825682 *****************************************************************************/
56835683
56845684GrantRoleStmt :
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
56865686{
56875687GrantRoleStmt *n = makeNode(GrantRoleStmt);
56885688n->is_grant =true ;
@@ -5695,7 +5695,7 @@ GrantRoleStmt:
56955695;
56965696
56975697RevokeRoleStmt :
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
56995699{
57005700GrantRoleStmt *n = makeNode(GrantRoleStmt);
57015701n->is_grant =false ;
@@ -5705,7 +5705,7 @@ RevokeRoleStmt:
57055705n->behavior =$6 ;
57065706$$ = (Node*)n;
57075707}
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
57095709{
57105710GrantRoleStmt *n = makeNode(GrantRoleStmt);
57115711n->is_grant =false ;
@@ -5751,11 +5751,11 @@ DefACLOption:
57515751{
57525752$$ = makeDefElem(" schemas" , (Node *)$3 );
57535753}
5754- | FOR ROLE name_list
5754+ | FOR ROLE role_list
57555755{
57565756$$ = makeDefElem(" roles" , (Node *)$3 );
57575757}
5758- | FOR USER name_list
5758+ | FOR USER role_list
57595759{
57605760$$ = makeDefElem(" roles" , (Node *)$3 );
57615761}
@@ -12204,6 +12204,12 @@ Iconst:ICONST{ $$ = $1; };
1220412204Sconst:SCONST{ $$ = $1 ; };
1220512205RoleId:NonReservedWord{ $$ = $1 ; };
1220612206
12207+ role_list:RoleId
12208+ { $$ =list_make1 (makeString ($1 )); }
12209+ | role_list' ,' RoleId
12210+ { $$ =lappend ($1 ,makeString ($3 )); }
12211+ ;
12212+
1220712213SignedIconst: Iconst{ $$ = $1 ; }
1220812214|' +' Iconst{ $$ = + $2 ; }
1220912215|' -' Iconst{ $$ = - $2 ; }