REVOKE
SQL - Language Statements
REVOKE
Revokes access privilege from a user, a group, or all users.
REVOKE { { SELECT | INSERT | UPDATE | DELETE | RULE | REFERENCES | TRIGGER } [,...] | ALL [ PRIVILEGES ] }
ON [ TABLE ] object [, ...]
FROM { username | GROUP groupname | PUBLIC } [, ...]
Description
REVOKE allows the creator of an object to revoke
permissions granted before, from a users or a group of users. The
key word PUBLIC means to revoke this privilege
from all users.
See the description of the command for
the meaning of the privilege types.
Notes
Use 's \z command to
display the privileges granted on existing objects. See also for information about the format.
Examples
Revoke insert privilege from all users on table
films:
REVOKE INSERT ON films FROM PUBLIC;
Revoke all privileges from user manuel on view kinds:
REVOKE ALL PRIVILEGES ON kinds FROM manuel;
Compatibility
SQL92
The compatibility notes of the command
apply analogously to REVOKE. The syntax summary is:
REVOKE [ GRANT OPTION FOR ] { SELECT | INSERT | UPDATE | DELETE | REFERENCES }
ON object [ ( column [, ...] ) ]
FROM { PUBLIC | username [, ...] }
{ RESTRICT | CASCADE }
If user1 gives a privilege WITH GRANT OPTION to user2,
and user2 gives it to user3 then user1 can revoke
this privilege in cascade using the CASCADE keyword.
If user1 gives a privilege WITH GRANT OPTION to user2,
and user2 gives it to user3, then if user1 tries to revoke
this privilege it fails if he specify the RESTRICT
keyword.
See Also