Commit 992d702b authored by Stephen Frost's avatar Stephen Frost

Ensure a few policies remain for pg_upgrade

To make sure that pg_dump/pg_restore function properly with RLS
policies, arrange to have a few of them left around at the end of the
regression tests.

Back-patch to 9.5 where RLS was added.
parent 590e2d12
...@@ -3026,3 +3026,12 @@ DROP USER rls_regress_user2; ...@@ -3026,3 +3026,12 @@ DROP USER rls_regress_user2;
DROP USER rls_regress_exempt_user; DROP USER rls_regress_exempt_user;
DROP ROLE rls_regress_group1; DROP ROLE rls_regress_group1;
DROP ROLE rls_regress_group2; DROP ROLE rls_regress_group2;
-- Arrange to have a few policies left over, for testing
-- pg_dump/pg_restore
CREATE SCHEMA rls_regress_schema;
CREATE TABLE rls_tbl (c1 int);
ALTER TABLE rls_tbl ENABLE ROW LEVEL SECURITY;
CREATE POLICY p1 ON rls_tbl USING (c1 > 5);
CREATE POLICY p2 ON rls_tbl FOR SELECT USING (c1 <= 3);
CREATE POLICY p3 ON rls_tbl FOR UPDATE USING (c1 <= 3) WITH CHECK (c1 > 5);
CREATE POLICY p4 ON rls_tbl FOR DELETE USING (c1 <= 3);
...@@ -671,6 +671,7 @@ SELECT user_relns() AS user_relns ...@@ -671,6 +671,7 @@ SELECT user_relns() AS user_relns
random_tbl random_tbl
real_city real_city
reltime_tbl reltime_tbl
rls_tbl
road road
shighway shighway
slow_emp4000 slow_emp4000
...@@ -708,7 +709,7 @@ SELECT user_relns() AS user_relns ...@@ -708,7 +709,7 @@ SELECT user_relns() AS user_relns
tvvmv tvvmv
varchar_tbl varchar_tbl
xacttest xacttest
(130 rows) (131 rows)
SELECT name(equipment(hobby_construct(text 'skywalking', text 'mer'))); SELECT name(equipment(hobby_construct(text 'skywalking', text 'mer')));
name name
......
...@@ -1307,3 +1307,13 @@ DROP USER rls_regress_user2; ...@@ -1307,3 +1307,13 @@ DROP USER rls_regress_user2;
DROP USER rls_regress_exempt_user; DROP USER rls_regress_exempt_user;
DROP ROLE rls_regress_group1; DROP ROLE rls_regress_group1;
DROP ROLE rls_regress_group2; DROP ROLE rls_regress_group2;
-- Arrange to have a few policies left over, for testing
-- pg_dump/pg_restore
CREATE SCHEMA rls_regress_schema;
CREATE TABLE rls_tbl (c1 int);
ALTER TABLE rls_tbl ENABLE ROW LEVEL SECURITY;
CREATE POLICY p1 ON rls_tbl USING (c1 > 5);
CREATE POLICY p2 ON rls_tbl FOR SELECT USING (c1 <= 3);
CREATE POLICY p3 ON rls_tbl FOR UPDATE USING (c1 <= 3) WITH CHECK (c1 > 5);
CREATE POLICY p4 ON rls_tbl FOR DELETE USING (c1 <= 3);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment