REVOKE (View)

Revokes user privileges on a view.

Important: In a database with trust authentication, the GRANT and REVOKE statements appear to work as expected but have no actual effect on the security of the database.

Syntax

REVOKE [ GRANT OPTION FOR ]... 
    { SELECT | ALL [ PRIVILEGES ]}
... ON [ [ db-name.]schema.]viewname [ , ... ]
... FROM { username | PUBLIC } [ , ... ]
... [ CASCADE ]

Parameters

GRANT OPTION FOR

Revokes the grant option for the privilege, not the privilege itself. If omitted, revokes both the privilege and the grant option.

SELECT

Revokes the user's ability to perform SELECT operations on a view and its referenced resources.

ALL
Revokes all previously granted 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
viewname

Specifies the view on which to revoke the privileges.

username

Revokes the privilege from the specified user.

PUBLIC

Revokes the privilege from all users.

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 SELECT privileges from user Joe on the view named test_view.

=> REVOKE SELECT ON test_view FROM Joe;
REVOKE PRIVILEGE

You can also use the database name and schema name in the command:

=> REVOKE SELECT ON VMart.public.test_view FROM Joe;
REVOKE PRIVILEGE

See Also