SQL REVOKE is a Data Control Language (DCL) command that removes permissions granted with the GRANT statement. Once executed, the targeted grantee (user, role, or public) immediately loses the specified privileges, preventing future operations that rely on those rights. REVOKE can operate at multiple scopes - entire databases, schemas, tables, columns, sequences, views, functions, procedures, or even server-level capabilities depending on the dialect. Most implementations support cascading effects: if a grantee had handed off the same privilege to others WITH GRANT OPTION, those dependent grants are also removed unless the syntax explicitly chooses RESTRICT. Because REVOKE changes security metadata, it commits implicitly in many systems and cannot be rolled back inside a transaction in some databases (notably MySQL). Administrators should audit dependent objects and active sessions after revocation, since long-running transactions may still hold locks or open cursors created before the privilege was revoked.
privilege_list
(list) - One or more privileges such as SELECT, INSERT, UPDATE, DELETE, REFERENCES, EXECUTE, USAGE, ALL.object_name
(identifier) - Database object the privilege applies to (table, view, sequence, function, etc.).grantee_list
(list) - User names, roles, or PUBLIC keyword.CASCADE
(keyword) - Automatically revoke any dependent privileges granted by the grantee. Default in many systems.RESTRICT
(keyword) - Fail if dependent grants exist, preventing accidental privilege chain breakage.SQL-92 Core Standard
The new privilege rules take effect on the next statement each session executes. A connection that already fetched data keeps that data but cannot issue new commands requiring the revoked right.
CASCADE removes dependent privileges granted by the affected user, ensuring no orphaned permissions remain. RESTRICT prevents the REVOKE if such dependencies exist, forcing you to clean them up manually first.
Yes in databases like PostgreSQL and Oracle. Use syntax such as `REVOKE SELECT(col1, col2) ON table_name FROM user1;`.
No. ALTER DEFAULT PRIVILEGES defines future grants. You must issue a separate REVOKE DEFAULT PRIVILEGES command (or its dialect equivalent) to change them.