SELECT * FROM atestv2; -- fail
ERROR: permission denied for relation atestv2
-SELECT * FROM atestv3; -- fail due to issue 3520503, see above
+SELECT * FROM atestv3; -- ok
one | two | three
-----+-----+-------
(0 rows)
ERROR: permission denied for relation int8_tbl
reset constraint_exclusion;
CREATE VIEW atestv4 AS SELECT * FROM atestv3; -- nested view
-SELECT * FROM atestv4; -- fail due to issue 3520503, see above
+SELECT * FROM atestv4; -- ok
one | two | three
-----+-----+-------
(0 rows)
-- Two complex cases:
SELECT * FROM atestv3; -- fail
ERROR: permission denied for relation atestv3
--- fail due to issue 3520503, see above
SELECT * FROM atestv4; -- ok (even though regress_user2 cannot access underlying atestv3)
one | two | three
-----+-----+-------
(0 rows)
-- test column-level privileges for INSERT and UPDATE
-INSERT INTO atest5 (two) VALUES (3); -- fail due to issue 3520503, see above
+INSERT INTO atest5 (two) VALUES (3); -- ok
COPY atest5 FROM stdin; -- fail
ERROR: permission denied for relation atest5
COPY atest5 (two) FROM stdin; -- ok
----
(0 rows)
-SELECT fy FROM atestp2; -- fail due to issue 3520503, see above
+SELECT fy FROM atestp2; -- ok
fy
----
(0 rows)
-SELECT atestp2 FROM atestp2; -- fail due to issue 3520503, see above
+SELECT atestp2 FROM atestp2; -- ok
atestp2
---------
(0 rows)
-SELECT oid FROM atestp2; -- fail due to issue 3520503, see above
+SELECT oid FROM atestp2; -- ok
oid
-----
(0 rows)
----
(0 rows)
-SELECT atestp2 FROM atestp2; -- fail due to issue 3520503, see above
+SELECT atestp2 FROM atestp2; -- ok
atestp2
---------
(0 rows)
ERROR: permission denied for function testfunc1
SELECT col1 FROM atest2 WHERE col2 = true; -- fail
ERROR: permission denied for relation atest2
-SELECT testfunc4(true); -- fail due to issue 3520503, see above
+SELECT testfunc4(true); -- ok
testfunc4
-----------
bar
SELECT * FROM atestv1; -- ok
SELECT * FROM atestv2; -- fail
-SELECT * FROM atestv3; -- fail due to issue 3520503, see above
+SELECT * FROM atestv3; -- ok
SELECT * FROM atestv0; -- fail
-- Appendrels excluded by constraints failed to check permissions in 8.4-9.2.
reset constraint_exclusion;
CREATE VIEW atestv4 AS SELECT * FROM atestv3; -- nested view
-SELECT * FROM atestv4; -- fail due to issue 3520503, see above
+SELECT * FROM atestv4; -- ok
GRANT SELECT ON atestv4 TO regress_user2;
SET SESSION AUTHORIZATION regress_user2;
-- Two complex cases:
SELECT * FROM atestv3; -- fail
--- fail due to issue 3520503, see above
SELECT * FROM atestv4; -- ok (even though regress_user2 cannot access underlying atestv3)
SELECT * FROM atest2; -- ok
SELECT one, two FROM atest5 NATURAL JOIN atest6; -- ok now
-- test column-level privileges for INSERT and UPDATE
-INSERT INTO atest5 (two) VALUES (3); -- fail due to issue 3520503, see above
+INSERT INTO atest5 (two) VALUES (3); -- ok
COPY atest5 FROM stdin; -- fail
COPY atest5 (two) FROM stdin; -- ok
1
SET SESSION AUTHORIZATION regress_user2;
SELECT fx FROM atestp2; -- ok
-SELECT fy FROM atestp2; -- fail due to issue 3520503, see above
-SELECT atestp2 FROM atestp2; -- fail due to issue 3520503, see above
-SELECT oid FROM atestp2; -- fail due to issue 3520503, see above
+SELECT fy FROM atestp2; -- ok
+SELECT atestp2 FROM atestp2; -- ok
+SELECT oid FROM atestp2; -- ok
SELECT fy FROM atestc; -- fail
SET SESSION AUTHORIZATION regress_user1;
SET SESSION AUTHORIZATION regress_user2;
SELECT fx FROM atestp2; -- still ok
SELECT fy FROM atestp2; -- ok
-SELECT atestp2 FROM atestp2; -- fail due to issue 3520503, see above
+SELECT atestp2 FROM atestp2; -- ok
SELECT oid FROM atestp2; -- ok
-- privileges on functions, languages
SET SESSION AUTHORIZATION regress_user3;
SELECT testfunc1(5); -- fail
SELECT col1 FROM atest2 WHERE col2 = true; -- fail
-SELECT testfunc4(true); -- fail due to issue 3520503, see above
+SELECT testfunc4(true); -- ok
SET SESSION AUTHORIZATION regress_user4;
SELECT testfunc1(5); -- ok