--- /home/t-ishii/work/pg_ivm/expected/pg_ivm.out 2022-04-01 11:04:34.640321241 +0900
+++ /home/t-ishii/work/pg_ivm/results/pg_ivm.out 2022-05-23 12:41:21.841068760 +0900
@@ -489,75 +489,76 @@
CREATE USER ivm_user;
SET SESSION AUTHORIZATION ivm_admin;
CREATE TABLE rls_tbl(id int, data text, owner name);
+ERROR: permission denied for schema public
+LINE 1: CREATE TABLE rls_tbl(id int, data text, owner name);
+ ^
INSERT INTO rls_tbl VALUES
(1,'foo','ivm_user'),
(2,'bar','postgres');
+ERROR: relation "rls_tbl" does not exist
+LINE 1: INSERT INTO rls_tbl VALUES
+ ^
CREATE TABLE num_tbl(id int, num text);
+ERROR: permission denied for schema public
+LINE 1: CREATE TABLE num_tbl(id int, num text);
+ ^
INSERT INTO num_tbl VALUES
(1,'one'),
(2,'two'),
(3,'three'),
(4,'four');
+ERROR: relation "num_tbl" does not exist
+LINE 1: INSERT INTO num_tbl VALUES
+ ^
CREATE POLICY rls_tbl_policy ON rls_tbl FOR SELECT TO PUBLIC USING(owner = current_user);
+ERROR: relation "rls_tbl" does not exist
CREATE POLICY rls_tbl_policy2 ON rls_tbl FOR INSERT TO PUBLIC WITH CHECK(current_user LIKE 'ivm_%');
+ERROR: relation "rls_tbl" does not exist
ALTER TABLE rls_tbl ENABLE ROW LEVEL SECURITY;
+ERROR: relation "rls_tbl" does not exist
GRANT ALL on rls_tbl TO PUBLIC;
+ERROR: relation "rls_tbl" does not exist
GRANT ALL on num_tbl TO PUBLIC;
+ERROR: relation "num_tbl" does not exist
SET SESSION AUTHORIZATION ivm_user;
SELECT create_immv('ivm_rls', 'SELECT * FROM rls_tbl');
-NOTICE: could not create an index on immv "ivm_rls" automatically
-DETAIL: This target list does not have all the primary key columns, or this view does not contain DISTINCT clause.
-HINT: Create an index on the immv for efficient incremental maintenance.
- create_immv
--------------
- 1
-(1 row)
-
+ERROR: relation "rls_tbl" does not exist
+LINE 1: SELECT create_immv('ivm_rls', 'SELECT * FROM rls_tbl');
+ ^
SELECT id, data, owner FROM ivm_rls ORDER BY 1,2,3;
- id | data | owner
-----+------+----------
- 1 | foo | ivm_user
-(1 row)
-
+ERROR: relation "ivm_rls" does not exist
+LINE 1: SELECT id, data, owner FROM ivm_rls ORDER BY 1,2,3;
+ ^
INSERT INTO rls_tbl VALUES
(3,'baz','ivm_user'),
(4,'qux','postgres');
+ERROR: relation "rls_tbl" does not exist
+LINE 1: INSERT INTO rls_tbl VALUES
+ ^
SELECT id, data, owner FROM ivm_rls ORDER BY 1,2,3;
- id | data | owner
-----+------+----------
- 1 | foo | ivm_user
- 3 | baz | ivm_user
-(2 rows)
-
+ERROR: relation "ivm_rls" does not exist
+LINE 1: SELECT id, data, owner FROM ivm_rls ORDER BY 1,2,3;
+ ^
SELECT create_immv('ivm_rls2', 'SELECT * FROM rls_tbl JOIN num_tbl USING(id)');
-NOTICE: could not create an index on immv "ivm_rls2" automatically
-DETAIL: This target list does not have all the primary key columns, or this view does not contain DISTINCT clause.
-HINT: Create an index on the immv for efficient incremental maintenance.
- create_immv
--------------
- 2
-(1 row)
-
+ERROR: relation "rls_tbl" does not exist
+LINE 1: SELECT create_immv('ivm_rls2', 'SELECT * FROM rls_tbl JOIN n...
+ ^
RESET SESSION AUTHORIZATION;
WITH
x AS (UPDATE rls_tbl SET data = data || '_2' where id in (3,4)),
y AS (UPDATE num_tbl SET num = num || '_2' where id in (3,4))
SELECT;
---
-(1 row)
-
+ERROR: relation "rls_tbl" does not exist
+LINE 2: x AS (UPDATE rls_tbl SET data = data || '_2' where id in (3...
+ ^
SELECT * FROM ivm_rls2 ORDER BY 1,2,3;
- id | data | owner | num
-----+-------+----------+---------
- 1 | foo | ivm_user | one
- 3 | baz_2 | ivm_user | three_2
-(2 rows)
-
+ERROR: relation "ivm_rls2" does not exist
+LINE 1: SELECT * FROM ivm_rls2 ORDER BY 1,2,3;
+ ^
DROP TABLE rls_tbl CASCADE;
-NOTICE: drop cascades to 2 other objects
-DETAIL: drop cascades to table ivm_rls
-drop cascades to table ivm_rls2
+ERROR: table "rls_tbl" does not exist
DROP TABLE num_tbl CASCADE;
+ERROR: table "num_tbl" does not exist
DROP USER ivm_user;
DROP USER ivm_admin;
-- prevent IMMV chanages
Here's the test results: