REVOKE
Description
command revokes previously granted privileges from one or more roles. The key word PUBLIC
refers to the implicitly defined group of all roles.
See the description of the GRANT command for the meaning of the privilege types.
Note that any particular role will have the sum of privileges granted directly to it, privileges granted to any role it is presently a member of, and privileges granted to PUBLIC
. Thus, for example, revoking SELECT
privilege from PUBLIC
does not necessarily mean that all roles have lost SELECT
privilege on the object: those who have it granted directly or via another role will still have it. Similarly, revoking SELECT
from a user might not prevent that user from using SELECT
if or another membership role still has SELECT
rights.
If GRANT OPTION FOR
is specified, only the grant option for the privilege is revoked, not the privilege itself. Otherwise, both the privilege and the grant option are revoked.
When revoking membership in a role, GRANT OPTION
is instead called ADMIN OPTION
, but the behavior is similar.
See GRANT.
Examples
Revoke insert privilege for the public on table films
:
Revoke all privileges from role on view topten
. Note that this actually means revoke all privileges that the current role granted (if not a superuser).
The compatibility notes of the command also apply to REVOKE
.
Either RESTRICT
or CASCADE
is required according to the standard, but Greenplum Database assumes RESTRICT
by default.
See Also
Parent topic: SQL Command Reference