Revoking Access From Database Roles

A superuser can revoke any role from a user or from another role using the REVOKE command. The simplest form of this command is:

REVOKE role [, ...] FROM { user | role | PUBLIC } [, ...]

See REVOKE (Role) in the SQL Reference Manual for details.

Example

To revoke access from a role, use the REVOKE (Role) statement:

  1. Connect to the database as a superuser:

    \c - dbadmin
  2. Revoke the commenter role from user Bob:

    => REVOKE commenter FROM bob;