8.29. REVOKE ROLES

Synopsis

  1. REVOKE
  2. [ ADMIN OPTION FOR ]
  3. role [, ...]
  4. FROM ( user | USER user | ROLE role) [, ...]
  5. [ GRANTED BY ( user | USER user | ROLE role | CURRENT_USER | CURRENT_ROLE ) ]

Description

Revokes the specified role(s) from the specified principal(s) in the current catalog.

If the ADMIN OPTION FOR clause is specified, the GRANT permission isrevoked instead of the role.

For the REVOKE statement for roles to succeed, the user executing it either shouldbe the role admin or should possess the GRANT option for the given role.

The optional GRANTED BY clause causes the role(s) to be revoked withthe specified principal as a revoker. If the GRANTED BY clause is notspecified, the roles are revoked by the current user as a revoker.

Examples

Revoke role bar from user foo

  1. REVOKE bar FROM USER foo;

Revoke admin option for roles bar and foo from user baz and role qux

  1. REVOKE ADMIN OPTION FOR bar, foo FROM USER baz, ROLE qux;

Limitations

Some connectors do not support role management.See connector documentation for more details.

See Also

CREATE ROLE, DROP ROLE, SET ROLE, GRANT ROLES