REVOKE (Sequence)
Revokes privileges on a sequence generator from a user or role. Optionally revokes privileges on all sequences within one or more schemas.
Syntax
REVOKE [ GRANT OPTION FOR ] ... { SELECT | ALL [ PRIVILEGES ] } ... ON SEQUENCE [ [ db-name.]schema.]sequence-name [ , ... ] ... | ON ALL SEQUENCES IN SCHEMA schema-name [, ...] ... FROM { username | PUBLIC | role } [ , ... ] ...[ CASCADE ]
Parameters
SELECT |
Revokes the right to use both the CURRVAL and NEXTVAL functions on the specified sequence. |
ALL |
Applies to all privileges. |
PRIVILEGES |
Is for SQL standard compatibility and is ignored. |
[db-name.]schema |
Specifies a schema. If multiple schemas are defined in the database, include the schema name. For example: myschema.thisDbObject |
sequence-name |
Specifies the sequence from which to revoke privileges. |
ON ALL SEQUENCES IN SCHEMA |
Revokes privileges on all sequences within one or more schemas from a user and/or role. |
username |
Revokes the privilege from the specified user. |
PUBLIC |
Revokes the privilege from all users. |
role |
Revokes the privilege from the specified role. |
CASCADE |
Revokes the privilege from the specified user or role and then from others. After a user or role has been granted a privilege, the user can grant that privilege to other users and roles. The CASCADE keyword first revokes the privilege from the initial user or role, and then from other grantees extended the privilege. |
Examples
This example shows how to revoke user Joe's privileges on the my_seq sequence.
=> REVOKE ALL PRIVILEGES ON SEQUENCE my_seq FROM Joe; REVOKE PRIVILEGE