diff options
author | Noah Misch <noah@leadboat.com> | 2015-10-03 20:19:57 -0400 |
---|---|---|
committer | Noah Misch <noah@leadboat.com> | 2015-10-03 20:20:50 -0400 |
commit | 01ba7894f3f72ea57d1cfdc4f40f6231bc6cd9cd (patch) | |
tree | 8153ebad55cc49f2cb534ec4be5c2e8f96d3071c /src/test/regress/sql/rowsecurity.sql | |
parent | cfddb5df5a84923160b23890d6086bcbcd1fd655 (diff) | |
download | postgresql-01ba7894f3f72ea57d1cfdc4f40f6231bc6cd9cd.tar.gz postgresql-01ba7894f3f72ea57d1cfdc4f40f6231bc6cd9cd.zip |
Make BYPASSRLS behave like superuser RLS bypass.
Specifically, make its effect independent from the row_security GUC, and
make it affect permission checks pertinent to views the BYPASSRLS role
owns. The row_security GUC thereby ceases to change successful-query
behavior; it can only make a query fail with an error. Back-patch to
9.5, where BYPASSRLS was introduced.
Diffstat (limited to 'src/test/regress/sql/rowsecurity.sql')
-rw-r--r-- | src/test/regress/sql/rowsecurity.sql | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/test/regress/sql/rowsecurity.sql b/src/test/regress/sql/rowsecurity.sql index 6ed0daf345f..7f8772fa26c 100644 --- a/src/test/regress/sql/rowsecurity.sql +++ b/src/test/regress/sql/rowsecurity.sql @@ -1070,17 +1070,15 @@ COPY copy_t FROM STDIN; --fail - insufficient privilege to bypass rls. SET row_security TO ON; COPY copy_t FROM STDIN; --fail - COPY FROM not supported by RLS. --- Check COPY TO as user with permissions and BYPASSRLS +-- Check COPY FROM as user with permissions and BYPASSRLS SET SESSION AUTHORIZATION rls_regress_exempt_user; -SET row_security TO OFF; +SET row_security TO ON; COPY copy_t FROM STDIN; --ok 1 abc 2 bcd 3 cde 4 def \. -SET row_security TO ON; -COPY copy_t FROM STDIN; --fail - COPY FROM not supported by RLS. -- Check COPY FROM as user without permissions. SET SESSION AUTHORIZATION rls_regress_user2; |