CREATE POLICY
Create policies,such as:
CREATE ROW POLICY test_row_policy_1 ON test.table1 AS {RESTRICTIVE|PERMISSIVE} TO test USING (id in (1, 2));
illustrate:
CREATE STORAGE POLICY test_storage_policy_1 PROPERTIES ("key"="value", ...);
illustrate:
Create a set of row security policies
CREATE ROW POLICY test_row_policy_1 ON test.table1 AS RESTRICTIVE TO test USING (c1 = 'a');
CREATE ROW POLICY test_row_policy_2 ON test.table1 AS RESTRICTIVE TO test USING (c2 = 'b');
CREATE ROW POLICY test_row_policy_3 ON test.table1 AS PERMISSIVE TO test USING (c3 = 'c');
CREATE ROW POLICY test_row_policy_3 ON test.table1 AS PERMISSIVE TO test USING (c4 = 'd');
When we execute the query on Table1, the rewritten SQL is
select * from (select * from table1 where c1 = 'a' and c2 = 'b' or c3 = 'c' or c4 = 'd')
Create policy for storage
CREATE STORAGE POLICY testPolicy PROPERTIES( "storage_resource" = "s3", "cooldown_datetime" = "2022-06-08 00:00:00" );
CREATE STORAGE POLICY testPolicy PROPERTIES( "storage_resource" = "s3", "cooldown_ttl" = "1d" );
CREATE, POLICY