DROP ROW LEVEL SECURITY POLICY
Description
Drops a row-level security policy from a table.
Precautions
Only the table owner or administrators can drop a row-level security policy from the table.
Syntax
DROP [ ROW LEVEL SECURITY ] POLICY [ IF EXISTS ] policy_name ON table_name [ CASCADE | RESTRICT ]
Parameters
- IF EXISTS
Reports a notice instead of an error if the specified row-level security policy does not exist.
- policy_name
Specifies the name of the row-level security policy to be dropped.
- table_name
Specifies the name of the table containing the row-level security policy.
- CASCADE | RESTRICT
Currently, no objects depend on row-level security policies. Therefore, CASCADE is equivalent to RESTRICT, and they are reserved to ensure backward compatibility.
Examples
-- Create data table all_data. openGauss=# CREATE TABLE all_data(id int, role varchar(100), data varchar(100)); -- Create a row-level security policy. openGauss=# CREATE ROW LEVEL SECURITY POLICY all_data_rls ON all_data USING(role = CURRENT_USER); -- Drop a row-level security policy. openGauss=# DROP ROW LEVEL SECURITY POLICY all_data_rls ON all_data; -- Drop the all_data table. openGauss=# DROP TABLE all_data;
Helpful Links
ALTER ROW LEVEL SECURITY POLICY and CREATE ROW LEVEL SECURITY POLICY
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot