FirebirdSQL logo

A REVOKE statement is used for revoking privileges — including roles — from users and other database objects.

REVOKE

Revokes privileges or role assignments

Available in

DSQL, ESQL

Syntax (revoking privileges)
REVOKE [GRANT OPTION FOR] <privileges>
  FROM <grantee_list>
  [{GRANTED BY | AS} [USER] grantor]

<privileges> ::=
  !! See GRANT syntax !!
Syntax (revoking roles)
REVOKE [ADMIN OPTION FOR] <role_granted_list>
  FROM <role_grantee_list>
  [{GRANTED BY | AS} [USER] grantor]

<role_granted_list> ::=
  !! See GRANT syntax !!

<role_grantee_list> ::=
  !! See GRANT syntax !!
Syntax (revoking all)
REVOKE ALL ON ALL FROM <grantee_list>

<grantee_list> ::=
  !! See GRANT syntax !!
Table 1. REVOKE Statement Parameters
Parameter Description

grantor

The grantor user on whose behalf the privilege(s) are being revoked

The REVOKE statement revokes privileges that were granted using the GRANT statement from users, roles, and other database objects.See GRANT for detailed descriptions of the various types of privileges.

Only the user who granted the privilege can revoke it.

The DEFAULT Clause

When the DEFAULT clause is specified, the role itself is not revoked, only its DEFAULT property is removed without revoking the role itself.

The FROM Clause

The FROM clause specifies a list of users, roles and other database objects that will have the enumerated privileges revoked.The optional USER keyword in the FROM clause allow you to specify exactly which type is to have the privilege revoked.If a USER (or ROLE) keyword is not specified, the server first checks for a role with this name and, if there is no such role, the privileges are revoked from the user with that name without further checking.

Tip
  • Although the USER keyword is optional, it is advisable to use them to avoid ambiguity with roles.

  • The REVOKE statement does not check for the existence of the user from which the privileges are being revoked.

  • When revoking a privilege from a database object other than USER or ROLE, you must specify its object type

Important
Revoking Privileges from user PUBLIC

Privileges that were granted to the special user named PUBLIC must be revoked from the user PUBLIC.User PUBLIC provides a way to grant privileges to all users at once, but it is not “a group of users”.