Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Gustafsson2021-12-30 12:23:47 +0000
committerDaniel Gustafsson2021-12-30 12:23:47 +0000
commite68570e388f08c2e36ce7d2a9564941b89db6549 (patch)
tree27e31034cf2e4675e4a40e7a23b7f1c2904fb51c /src/backend
parent8112bcf0cc602e00e95eab6c4bdc0eb73b5b547d (diff)
Revert b2a459edf "Fix GRANTED BY support in REVOKE ROLE statements"
The reverted commit attempted to fix SQL specification compliance for the cases which 6aaaa76bb left. This however broke existing behavior which takes precedence over spec compliance so revert. The introduced tests are left after the revert since the codepath isn't well covered. Per bug report 17346. Backpatch down to 14 where it was introduced. Reported-by: Andrew Bille <andrewbille@gmail.com> Discussion: https://postgr.es/m/17346-f72b28bd1a341060@postgresql.org
Diffstat (limited to 'src/backend')
-rw-r--r--src/backend/commands/user.c11
-rw-r--r--src/backend/parser/gram.y2
2 files changed, 0 insertions, 13 deletions
diff --git a/src/backend/commands/user.c b/src/backend/commands/user.c
index c8c0dd0dd53..aa69821be49 100644
--- a/src/backend/commands/user.c
+++ b/src/backend/commands/user.c
@@ -1259,18 +1259,7 @@ GrantRole(GrantRoleStmt *stmt)
ListCell *item;
if (stmt->grantor)
- {
grantor = get_rolespec_oid(stmt->grantor, false);
-
- /*
- * Currently, this clause is only for SQL compatibility, not very
- * interesting otherwise.
- */
- if (grantor != GetUserId())
- ereport(ERROR,
- (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("grantor must be current user")));
- }
else
grantor = GetUserId();
diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y
index 3d4dd43e47b..2a319eecda0 100644
--- a/src/backend/parser/gram.y
+++ b/src/backend/parser/gram.y
@@ -7284,7 +7284,6 @@ RevokeRoleStmt:
n->admin_opt = false;
n->granted_roles = $2;
n->grantee_roles = $4;
- n->grantor = $5;
n->behavior = $6;
$$ = (Node*)n;
}
@@ -7295,7 +7294,6 @@ RevokeRoleStmt:
n->admin_opt = true;
n->granted_roles = $5;
n->grantee_roles = $7;
- n->grantor = $8;
n->behavior = $9;
$$ = (Node*)n;
}