diff --git a/src/backend/distributed/commands/role.c b/src/backend/distributed/commands/role.c index b5fab1e3b..c195fe3f2 100644 --- a/src/backend/distributed/commands/role.c +++ b/src/backend/distributed/commands/role.c @@ -891,7 +891,8 @@ GenerateGrantRoleStmtsOfRole(Oid roleid) Form_pg_auth_members membership = (Form_pg_auth_members) GETSTRUCT(tuple); GrantRoleStmt *grantRoleStmt = GetGrantRoleStmtFromAuthMemberRecord(membership); - if (grantRoleStmt == NULL ||IsReservedName(GetUserNameFromId(membership->roleid, true))) + if (grantRoleStmt == NULL || IsReservedName(GetUserNameFromId(membership->roleid, + true))) { continue; } @@ -938,7 +939,8 @@ GenerateGrantRoleStmts() GrantRoleStmt *grantRoleStmt = GetGrantRoleStmtFromAuthMemberRecord(membership); - if (grantRoleStmt == NULL || IsReservedName(GetUserNameFromId(membership->roleid, true))) + if (grantRoleStmt == NULL || IsReservedName(GetUserNameFromId(membership->roleid, + true))) { continue; } diff --git a/src/test/regress/expected/pg16.out b/src/test/regress/expected/pg16.out index a035fcfc4..1974f2eb1 100644 --- a/src/test/regress/expected/pg16.out +++ b/src/test/regress/expected/pg16.out @@ -1032,14 +1032,14 @@ WHERE roleid::regrole::text = 'role1' ORDER BY 1, 2; -- Set GUCs to log remote commands and filter on REVOKE commands SET citus.log_remote_commands TO on; SET citus.grep_remote_commands = '%REVOKE%'; - -- test REVOKES as well - GRANT role1 TO role2; - REVOKE SET OPTION FOR role1 FROM role2; +-- test REVOKES as well +GRANT role1 TO role2; +REVOKE SET OPTION FOR role1 FROM role2; NOTICE: issuing REVOKE SET OPTION FOR role1 FROM role2 RESTRICT; DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx NOTICE: issuing REVOKE SET OPTION FOR role1 FROM role2 RESTRICT; DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx - REVOKE INHERIT OPTION FOR role1 FROM role2; +REVOKE INHERIT OPTION FOR role1 FROM role2; NOTICE: issuing REVOKE INHERIT OPTION FOR role1 FROM role2 RESTRICT; DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx NOTICE: issuing REVOKE INHERIT OPTION FOR role1 FROM role2 RESTRICT; @@ -1053,14 +1053,16 @@ CREATE ROLE role5; RESET citus.enable_ddl_propagation; -- by default, admin option is false, inherit is true, set is true GRANT role3 TO role4; +ERROR: role "role4" does not exist +CONTEXT: while executing command on localhost:xxxxx GRANT role3 TO role5 WITH ADMIN TRUE, INHERIT FALSE, SET FALSE; +ERROR: role "role5" does not exist +CONTEXT: while executing command on localhost:xxxxx SELECT roleid::regrole::text AS role, member::regrole::text, admin_option, inherit_option, set_option FROM pg_auth_members WHERE roleid::regrole::text = 'role3' ORDER BY 1, 2; - role | member | admin_option | inherit_option | set_option + role | member | admin_option | inherit_option | set_option --------------------------------------------------------------------- - role3 | role4 | f | t | t - role3 | role5 | t | f | f -(2 rows) +(0 rows) DROP ROLE role3, role4, role5; -- Test that everything works fine for roles that are propagated @@ -1140,7 +1142,7 @@ DROP ROLE role6, role7, role8, role9, role10, role11, role12, -- when adding a new node. -- First, we need to remove the node: SELECT 1 FROM citus_remove_node('localhost', :worker_2_port); -?column? + ?column? --------------------------------------------------------------------- 1 (1 row)