> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kinetica.com/llms.txt
> Use this file to discover all available pages before exploring further.

# REVOKE Table Permission

[Table permissions](https://docs.kinetica.com/content/security/sec_concepts.md#security-concepts-permissions-table), which can
be applied to tables and views, can be revoked from
[users](https://docs.kinetica.com/content/security/sec_concepts.md#security-concepts-users) or
[roles](https://docs.kinetica.com/content/security/sec_concepts.md#security-concepts-roles).

[Row-level security](https://docs.kinetica.com/content/security/sec_concepts.md#sec-concepts-perm-table-row) can be revoked for
`SELECT` privilege only by revoking `SELECT` privilege from the entire
table.

> [!NOTE]
>
> Access to individual rows cannot be revoked; instead, full `SELECT`
> access should be revoked, followed by a grant of access to the appropriate
> rows.

[Column-level security](https://docs.kinetica.com/content/security/sec_concepts.md#sec-concepts-perm-table-col) can be revoked for
`SELECT` privilege by specifying a list of columns for which access will be
revoked, regardless of any security functions that may have been applied to the
column when granting access (`HASH`, `MASK`).

```sql title="REVOKE Table Permission Syntax" theme={null}
REVOKE < SELECT | INSERT | UPDATE | DELETE | ALL > [PRIVILEGES]
ON <ALL TABLES [IN [SCHEMA] <schema reference>] | [TABLE | SCHEMA] <object reference> [<column list>]>
FROM <user name | role name>
```

```sql title="REVOKE Create Table Permission Syntax" theme={null}
REVOKE CREATE [PRIVILEGES] ON TABLES
[IN [SCHEMA] <schema reference>]
FROM <user name | role name>
```

## Parameters

> [accordion] PRIVILEGES
>
> Optional keyword for SQL-92 compatibility

> [accordion] TABLE / SCHEMA
>
> Optional SQL-92 keywords that disambiguate the object reference: `TABLE` selects a
> table/view in the user's default schema (when the schema is omitted), while `SCHEMA`
> selects a schema.

> [accordion] \<object reference>
>
> The name of the table/view and/or schema to which access is being revoked; the following
> forms are valid:
>
> <table>
>   <thead>
>     <tr>
>       <th>Form</th>
>       <th>Selected Objects</th>
>     </tr>
>   </thead>
>
>   <tbody>
>     <tr>
>       <td>*\<schema>.\<object>*</td>
>       <td>Fully-qualified table or view name in the specified schema</td>
>     </tr>
>
>     <tr>
>       <td>`.`</td>
>       <td>All existing tables & views that the revoking user can see, across all schemas</td>
>     </tr>
>
>     <tr>
>       <td>`*`</td>
>       <td>All schemas the revoking user can see, removing access to all tables and views in those schemas now and in the future</td>
>     </tr>
>
>     <tr>
>       <td>*\<schema>*</td>
>       <td>All tables and views in the specified schema now and in the future</td>
>     </tr>
>
>     <tr>
>       <td>*\<object>*</td>
>       <td>Table or view in the default schema.  If a schema exists with the same name, it will be used.  To avoid this, specify the fully-qualified object name.</td>
>     </tr>
>   </tbody>
> </table>

> [accordion] \<schema reference>
>
> The schema the permission applies to (with the ALL or CREATE forms).  If the IN \[SCHEMA]
> clause is omitted, the permission is removed from all schemas, both now and in the
> future.  Wildcards are not permitted with the IN keyword.

> [accordion] \<column list>
>
> Optional comma-separated list of specific table columns to which access is being revoked;
> see [Column-Level Security](https://docs.kinetica.com/content/security/sec_concepts.md#sec-concepts-perm-table-col) for details

> [!NOTE]
>
> The `ALL` permission corresponds to the native
> [table\_admin](https://docs.kinetica.com/content/security/sec_concepts.md#security-concepts-permissions-table) permission, which
> gives full read/write access as well as the additional permission either to
> `ALTER` and `DROP` the specified table or to `CREATE`, `ALTER`, &
> `DROP` all tables in the specified schema.

## Examples

For example, to revoke full access on the **network\_config** table from
**jsmith**:

```sql REVOKE All Permissions on Table from User Example theme={null}
REVOKE ALL PRIVILEGES ON TABLE example.network_config FROM jsmith
```

To revoke `SELECT` access on the **network\_config\_history** table from the
**analyst** role:

```sql REVOKE Read on Table from Role Example theme={null}
REVOKE SELECT ON example.network_config_history FROM analyst
```

To revoke full access on each of the tables & views within the **example**
schema from the **developer** role:

```sql REVOKE All Permissions on Current Tables/Views in Schema from Role Example theme={null}
REVOKE ALL ON example.* FROM developer
```

To revoke `SELECT` access on all schemas from the **auditor** role:

```sql REVOKE Read on Schemas from Role Example theme={null}
REVOKE SELECT ON * FROM auditor
```

To revoke `SELECT` access on all current and future tables & views within the
**app\_schema** schema from the **app\_user** role:

```sql REVOKE Read on Schema from Role Example theme={null}
REVOKE SELECT ON app_schema FROM app_user
```

To revoke full access on each of the schemas, tables, & views in the database
individually from the **dbadmin** role:

```sql REVOKE All Permissions on All Schemas/Tables/Views from Role Example theme={null}
REVOKE ALL ON *.* FROM dbadmin
```

## Row-Level Security Examples

To revoke `SELECT` access on an **rx\_order** table for all orders placed since
the year **2002** (as was granted in the
[row-level grant example](https://docs.kinetica.com/content/sql/security/grant-table-permission.md#sql-security-priv-mgmt-row-grant)), revoke all
`SELECT` access:

```sql REVOKE Row-Level Access Example theme={null}
REVOKE SELECT ON example.rx_order FROM zanalyst
```

## Column-Level Security Examples

To revoke `SELECT` access on the following columns of an **rx\_order** table:

* orderer's social security number

```sql REVOKE Obfuscated Column-Level Access Example theme={null}
REVOKE SELECT ON example.rx_order(ssn) FROM zanalyst
```

To revoke `SELECT` access on the following columns of an **rx\_order** table:

* masked version of the orderer's social security number (last 4 digits)
* name of the prescription ordered

```sql REVOKE Masked Column-Level Access Example theme={null}
REVOKE SELECT ON example.rx_order(ssn, rx_name) FROM rx_user
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.