DETACH RLS POLICY
Detach a row-level security policy on a table from one or more users or roles.
Superusers and users or roles that have the sys:secadmin
role can detach a
policy.
Syntax
DETACH RLS POLICY policy_name ON [TABLE] table_name [, ...] FROM { user_name | ROLE role_name | PUBLIC } [, ...]
Parameters
- policy_name
-
The name of the policy.
- ON [TABLE] table_name [, ...]
-
The table or view that the row-level security policy is detached from.
- FROM { user_name | ROLE role_name | PUBLIC} [, ...]
-
Specifies whether the policy is detached from one or more specified users or roles.
Usage notes
When working with the DETACH RLS POLICY statement, observe the following:
-
You can detach a policy from a relation, user, role, or public.
Examples
The following example detaches a policy on a table from a role.
DETACH RLS POLICY policy_concerts ON tickit_category_redshift FROM ROLE analyst, ROLE dbadmin;