REVOKE ROLE¶
Removes a role from another role or a user.
- See also:
Syntax¶
Parameters¶
nameSpecifies the identifier for the role to revoke. If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive.
ROLE parent_role_nameRevokes the role from the specified role.
USER user_nameRevokes the role from the specified user.
Optional parameters¶
GRANT OPTION FORIf specified, removes the ability for the recipient role to grant the role to another role. The role grant itself remains, so the recipient role still inherits the granted role’s privileges.
Default: No value, which revokes the role grant.
RESTRICT | CASCADEDetermines whether the revoke operation succeeds when the role has been re-granted to another role. These clauses apply to
REVOKE ROLE ... FROM ROLE.RESTRICT: If the role being revoked has been re-granted to another role, the REVOKE command fails.CASCADE: If the role being revoked has been re-granted, the REVOKE command recursively revokes these dependent grants.GRANT OPTION FOR ... CASCADErevokes the dependent grants and leaves the role grant in place without the grant option.CASCADEwithoutGRANT OPTION FORrevokes the role grant and the dependent grants.
Default:
RESTRICT
Examples¶
Remove only the grant option from the data_steward role. data_steward keeps the analyst role:
Revoke the analyst role from data_steward, including grants of analyst that data_steward made: