> This page location: Roles & Privileges > Revoke Privileges
> Full Neon documentation index: https://neon.com/docs/llms.txt

# PostgreSQL REVOKE Statement

**Summary**: in this tutorial, you will learn about the PostgreSQL `REVOKE` statement to remove privileges from a role.

## Introduction to the PostgreSQL REVOKE statement

The `REVOKE` statement revokes previously [granted privileges](https://neon.com/postgresql/postgresql-administration/postgresql-grant) on database objects from a [role](https://neon.com/postgresql/postgresql-administration/postgresql-roles).

The following shows the syntax of the `REVOKE` statement that revokes privileges on one or more tables from a role:

```sql
REVOKE privilege | ALL
ON TABLE table_name |  ALL TABLES IN SCHEMA schema_name
FROM role_name;
```

In this syntax:

- First, specify one or more privileges that you want to revoke or use the `ALL` option to revoke all privileges.
- Second, provide the name of the table after the `ON` keyword or use the `ALL TABLES` to revoke specified privileges from all tables in a schema.
- Third, specify the name of the role from which you want to revoke privileges.

## PostgreSQL REVOKE statement example

Let's take an example of using the `REVOKE` statement.

### Step 1. Create a role and grant privileges

First, use the `postgres` user to log in to the `dvdrental` [sample database](../postgresql-getting-started/postgresql-sample-database):

```bash
psql -U postgres -d dvdrental
```

Second, [create a new role](https://neon.com/postgresql/postgresql-administration/postgresql-roles) called `jim` with the `LOGIN` and `PASSWORD` attributes:

```sql
CREATE ROLE jim LOGIN PASSWORD 'YourPassword';
```

Replace the `YourPassword` with the one you want.

Third, grant all privileges to the role `jim` on the `film` table:

```sql
GRANT ALL ON film TO jim;
```

Finally, grant the `SELECT` privilege on the `actor` table to the role `jim`:

```sql
GRANT SELECT ON actor TO jim;
```

### Step 2. Revoke privileges from a role

To revoke the `SELECT` privilege on the `actor` table from the role `jim`, you use the following statement:

```sql
REVOKE SELECT ON actor FROM jim;
```

To revoke all privileges on the `film` table from the role `jim`, you use `REVOKE` statement with the `ALL` option like this:

```sql
REVOKE ALL ON film FROM jim;
```

## Revoking privileges on other database objects

To revoke privileges from other database objects such as [sequences](../postgresql-tutorial/postgresql-sequences), [functions](../postgresql-functions), [stored procedures](../postgresql-plpgsql/postgresql-create-procedure), [schemas](https://neon.com/postgresql/postgresql-administration/postgresql-schema), and [databases](https://neon.com/postgresql/postgresql-administration/postgresql-create-database), check out the [REVOKE statement](https://www.postgresql.org/docs/current/sql-revoke.html).

## Summary

- Use the PostgreSQL `REVOKE` statement to revoke previously granted privileges on database objects from a role.

---

## Related docs (Roles & Privileges)

- [Create Roles](https://neon.com/postgresql/postgresql-administration/postgresql-roles)
- [Grant Privileges](https://neon.com/postgresql/postgresql-administration/postgresql-grant)
- [Alter roles](https://neon.com/postgresql/postgresql-administration/postgresql-alter-role)
- [Drop Roles](https://neon.com/postgresql/postgresql-administration/postgresql-drop-role)
- [Role Membership](https://neon.com/postgresql/postgresql-administration/postgresql-role-membership)
- [SET ROLE Statement](https://neon.com/postgresql/postgresql-administration/postgresql-set-role)
- [CURRENT_USER](https://neon.com/postgresql/postgresql-administration/postgresql-current_user)
- [List Roles](https://neon.com/postgresql/postgresql-administration/postgresql-list-users)
- [Change Password](https://neon.com/postgresql/postgresql-administration/postgresql-change-password)
- [Create Superusers](https://neon.com/postgresql/postgresql-administration/create-superuser-postgresql)
- [PostgreSQL Row-Level Security](https://neon.com/postgresql/postgresql-administration/postgresql-row-level-security)
