Skip to main content
Use REVOKE to remove specific privileges or roles from a user or a role. For the privileges supported by the database, see Privileges supported by the database. Tip
  • Common users can only revoke their privileges that have the WITH GRANT OPTION keyword from other users and roles. For information about WITH GRANT OPTION, see GRANT.
  • Only users with the user_admin role has the privilege to revoke privileges from other users.

Syntax

Revoke privileges

The privileges that can be revoked are object-specific. The following part describes syntax based on objects.

System

AI functions and providers

Revocation applies to subsequent executions and replanning, including prepared EXECUTE. It does not cancel an in-flight query. This feature adds native authorization checks; external access controllers that do not implement AI checks deny these operations.

Resource group

Resource

User

Global UDF

Internal catalog

External catalog

Database

  • You must first run SET CATALOG before you run this command.

Table

  • You must first run SET CATALOG before you run this command.
  • You can also use db.tbl to represent a table.

View

  • You must first run SET CATALOG before you run this command.
  • You can also use db.view to represent a view.
  • For the EXPORT privilege, only grant and revoke are supported. Exporting the view via EXPORT TABLE is not supported.

Materialized view

  • You must first run SET CATALOG before you run this command.
  • You can also use db.mv to represent an mv.
  • For the EXPORT privilege, only grant and revoke are supported. Exporting the materialized view via EXPORT TABLE is not supported.

Function

  • You must first run SET CATALOG before you run this command.
  • You can also use db.function to represent a function.

Storage volume

Revoke roles

Parameters

Examples

Revoke privileges

Revoke the SELECT privilege on table sr_member from user jack:
Revoke the USAGE privilege on resource spark_resource from role test_role:

Revoke roles

Revoke the role example_role from user jack:
Revoke the role example_role from role test_role:

References

GRANT