You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Andres pointed out that there was an extra ';' in equalPolicies, which
made me realize that my prior testing with CLOBBER_CACHE_ALWAYS was
insufficient (it didn't always catch the issue, just most of the time).
Thanks to that, a different issue was discovered, specifically in
equalRSDescs. This change corrects eqaulRSDescs to return 'true' once
all policies have been confirmed logically identical. After stepping
through both functions to ensure correct behavior, I ran this for
about 12 hours of CLOBBER_CACHE_ALWAYS runs of the regression tests
with no failures.
In addition, correct a few typos in the documentation which were pointed
out by Thom Brown (thanks!) and improve the policy documentation further
by adding a flushed out usage example based on a unix passwd file.
Lastly, clean up a few comments in the regression tests and pg_dump.h.
Copy file name to clipboardExpand all lines: src/test/regress/sql/rowsecurity.sql
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -84,7 +84,7 @@ INSERT INTO document VALUES
84
84
85
85
ALTERTABLE document ENABLE ROW LEVEL SECURITY;
86
86
87
-
-- user's security level must be higher that or equal to document's
87
+
-- user's security level must be higher than or equal to document's
88
88
CREATE POLICY p1 ON document
89
89
USING (dlevel <= (SELECT seclv FROM uaccount WHERE pguser =current_user));
90
90
@@ -136,7 +136,7 @@ SET SESSION AUTHORIZATION rls_regress_user1;
136
136
SELECT*FROM document d FULL OUTER JOIN category c ond.cid=c.cid;
137
137
DELETEFROM category WHERE cid =33; -- fails with FK violation
138
138
139
-
--cannot insert FK referencing invisible PK
139
+
--can insert FK referencing invisible PK
140
140
SET SESSION AUTHORIZATION rls_regress_user2;
141
141
SELECT*FROM document d FULL OUTER JOIN category c ond.cid=c.cid;
142
142
INSERT INTO document VALUES (10, 33, 1, current_user, 'hoge');
@@ -146,19 +146,19 @@ SET SESSION AUTHORIZATION rls_regress_user1;
146
146
INSERT INTO document VALUES (8, 44, 1, 'rls_regress_user1', 'my third manga'); -- Must fail with unique violation, revealing presence of did we can't see
147
147
SELECT*FROM document WHERE did =8; -- and confirm we can't see it
148
148
149
-
-- database superuser cannot bypass RLS policy when enabled
149
+
-- database superuser does bypass RLS policy when enabled
150
150
RESET SESSION AUTHORIZATION;
151
151
SET row_security TO ON;
152
152
SELECT*FROM document;
153
153
SELECT*FROM category;
154
154
155
-
-- database superuser cannot bypass RLS policy when FORCE enabled.
155
+
-- database superuser does not bypass RLS policy when FORCE enabled.
156
156
RESET SESSION AUTHORIZATION;
157
157
SET row_security TO FORCE;
158
158
SELECT*FROM document;
159
159
SELECT*FROM category;
160
160
161
-
-- database superuser can bypass RLS policy when disabled
161
+
-- database superuser does bypass RLS policy when disabled
0 commit comments