From 62e0d0d01b74c5b0d0c8e245713f290306f10899 Mon Sep 17 00:00:00 2001 From: Jodi-Ann Francis <53411733+francisjodi@users.noreply.github.com> Date: Wed, 30 Aug 2023 15:09:59 -0400 Subject: [PATCH] Review changes --- .../distributed/deparser/deparse_role_stmts.c | 32 ++++++------------- 1 file changed, 10 insertions(+), 22 deletions(-) diff --git a/src/backend/distributed/deparser/deparse_role_stmts.c b/src/backend/distributed/deparser/deparse_role_stmts.c index 8377e23bc..7379d1a99 100644 --- a/src/backend/distributed/deparser/deparse_role_stmts.c +++ b/src/backend/distributed/deparser/deparse_role_stmts.c @@ -409,28 +409,16 @@ AppendRevokeAdminOptionFor(StringInfo buf, GrantRoleStmt *stmt) { switch (opt->defname) { - case "admin": - appendStringInfo(buf, "ADMIN OPTION FOR "); - opt_count++; - break; - - case "inherit": - if (opt_count > 0) - { - appendStringInfo(buf, ", "); - } - appendStringInfo(buf, "INHERIT OPTION FOR "); - opt_count++; - break; - - case "set": - if (opt_count > 0) - { - appendStringInfo(buf, ", "); - } - appendStringInfo(buf, "SET OPTION FOR "); - opt_count++; - break; + appendStringInfo(buf, "ADMIN OPTION FOR "); + } + else if (strcmp(opt->defname, "inherit") == 0); + { + appendStringInfo(buf, "INHERIT TRUE"); + appendStringInfo(buf, "GRANT x TO y WITH INHERIT TRUE, SET TRUE;"); + } + else if (strcmp(opt->defname, "set") == 0) + { + appendStringInfo(buf, "SET TRUE"); } } }