Help Center > > Developer Guide> SQL Reference> SQL Syntax> DROP ROW LEVEL SECURITY POLICY

DROP ROW LEVEL SECURITY POLICY

Updated at: Jul 15, 2020 GMT+08:00

Function

DROP ROW LEVEL SECURITY POLICY deletes a row-level access control policy from a table.

Precautions

Only the table owner or administrators can delete a row-level access control policy from the table.

Syntax

1
DROP [ ROW LEVEL SECURITY ] POLICY [ IF EXISTS ] policy_name ON table_name [ CASCADE | RESTRICT ]

Parameter Description

  • IF EXISTS

    Reports a notice instead of an error if the specified row-level access control policy does not exist.

  • policy_name
    Specifies the name of a row-level access control policy to be deleted.
    • table_name

      Specifies the name of a table to which a row-level access control policy is applied.

    • CASCADE/RESTRICT

      The two parameters are used only for syntax compatibility. No objects depend on access control policies and thereby CASCADE is equivalent to RESTRICT.

Examples

1
2
3
4
5
6
7
8
-- Create the data table all_data.
CREATE TABLE all_data(id int, role varchar(100), data varchar(100));

-- Create a row-level access control policy.
CREATE ROW LEVEL SECURITY POLICY all_data_rls ON all_data USING(role = CURRENT_USER);

-- Delete the row-level access control policy.
DROP ROW LEVEL SECURITY POLICY all_data_rls ON all_data;

Did you find this page helpful?

Submit successfully!

Thank you for your feedback. Your feedback helps make our documentation better.

Failed to submit the feedback. Please try again later.

Which of the following issues have you encountered?







Please complete at least one feedback item.

Content most length 200 character

Content is empty.

OK Cancel