1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
|
--
-- OAT checks for ALTER TABLE
--
-- This test script fails if debug_discard_caches is enabled, because cache
-- flushes cause extra calls of the OAT hook in recomputeNamespacePath,
-- resulting in more NOTICE messages than are in the expected output.
SET debug_discard_caches = 0;
LOAD 'test_oat_hooks';
SET test_oat_hooks.audit = true;
NOTICE: in object_access_hook_str: superuser attempting alter (subId=0x1000, set) [test_oat_hooks.audit]
NOTICE: in object_access_hook_str: superuser finished alter (subId=0x1000, set) [test_oat_hooks.audit]
NOTICE: in process utility: superuser finished SET
CREATE SCHEMA test_oat_schema;
NOTICE: in process utility: superuser attempting CREATE SCHEMA
NOTICE: in object access: superuser attempting create (subId=0x0) [explicit]
NOTICE: in object access: superuser finished create (subId=0x0) [explicit]
NOTICE: in process utility: superuser finished CREATE SCHEMA
CREATE TABLE test_oat_schema.test_oat_tab (c1 int, c2 text);
NOTICE: in process utility: superuser attempting CREATE TABLE
NOTICE: in object access: superuser attempting namespace search (subId=0x0) [report on violation, allowed]
LINE 1: CREATE TABLE test_oat_schema.test_oat_tab (c1 int, c2 text);
^
NOTICE: in object access: superuser finished namespace search (subId=0x0) [report on violation, allowed]
LINE 1: CREATE TABLE test_oat_schema.test_oat_tab (c1 int, c2 text);
^
NOTICE: in object access: superuser attempting namespace search (subId=0x0) [no report on violation, allowed]
NOTICE: in object access: superuser finished namespace search (subId=0x0) [no report on violation, allowed]
NOTICE: in object access: superuser attempting namespace search (subId=0x0) [report on violation, allowed]
NOTICE: in object access: superuser finished namespace search (subId=0x0) [report on violation, allowed]
NOTICE: in object access: superuser attempting create (subId=0x0) [explicit]
NOTICE: in object access: superuser finished create (subId=0x0) [explicit]
NOTICE: in object access: superuser attempting create (subId=0x0) [explicit]
NOTICE: in object access: superuser finished create (subId=0x0) [explicit]
NOTICE: in object access: superuser attempting create (subId=0x0) [explicit]
NOTICE: in object access: superuser finished create (subId=0x0) [explicit]
NOTICE: in object access: superuser attempting create (subId=0x0) [internal]
NOTICE: in object access: superuser finished create (subId=0x0) [internal]
NOTICE: in object access: superuser attempting create (subId=0x0) [internal]
NOTICE: in object access: superuser finished create (subId=0x0) [internal]
NOTICE: in process utility: superuser finished CREATE TABLE
CREATE RULE test_oat_notify AS
ON UPDATE TO test_oat_schema.test_oat_tab
DO ALSO NOTIFY test_oat_tab;
NOTICE: in process utility: superuser attempting CREATE RULE
NOTICE: in object access: superuser attempting namespace search (subId=0x0) [report on violation, allowed]
NOTICE: in object access: superuser finished namespace search (subId=0x0) [report on violation, allowed]
NOTICE: in object access: superuser attempting namespace search (subId=0x0) [report on violation, allowed]
NOTICE: in object access: superuser finished namespace search (subId=0x0) [report on violation, allowed]
NOTICE: in object access: superuser attempting create (subId=0x0) [explicit]
NOTICE: in object access: superuser finished create (subId=0x0) [explicit]
NOTICE: in process utility: superuser finished CREATE RULE
CREATE FUNCTION test_oat_schema.test_trigger()
RETURNS trigger
LANGUAGE plpgsql
AS $$
BEGIN
IF TG_OP = 'DELETE'
THEN
RETURN OLD;
ELSE
RETURN NEW;
END IF;
END; $$;
NOTICE: in process utility: superuser attempting CREATE FUNCTION
NOTICE: in object access: superuser attempting namespace search (subId=0x0) [no report on violation, allowed]
NOTICE: in object access: superuser finished namespace search (subId=0x0) [no report on violation, allowed]
NOTICE: in object access: superuser attempting create (subId=0x0) [explicit]
NOTICE: in object access: superuser finished create (subId=0x0) [explicit]
NOTICE: in process utility: superuser finished CREATE FUNCTION
CREATE TRIGGER test_oat_trigger BEFORE INSERT ON test_oat_schema.test_oat_tab
FOR EACH STATEMENT EXECUTE FUNCTION test_oat_schema.test_trigger();
NOTICE: in process utility: superuser attempting CREATE TRIGGER
NOTICE: in object access: superuser attempting namespace search (subId=0x0) [report on violation, allowed]
NOTICE: in object access: superuser finished namespace search (subId=0x0) [report on violation, allowed]
NOTICE: in object access: superuser attempting namespace search (subId=0x0) [report on violation, allowed]
NOTICE: in object access: superuser finished namespace search (subId=0x0) [report on violation, allowed]
NOTICE: in object access: superuser attempting create (subId=0x0) [explicit]
NOTICE: in object access: superuser finished create (subId=0x0) [explicit]
NOTICE: in process utility: superuser finished CREATE TRIGGER
-- RLS
ALTER TABLE test_oat_schema.test_oat_tab ENABLE ROW LEVEL SECURITY;
NOTICE: in process utility: superuser attempting ALTER TABLE
NOTICE: in object access: superuser attempting namespace search (subId=0x0) [report on violation, allowed]
NOTICE: in object access: superuser finished namespace search (subId=0x0) [report on violation, allowed]
NOTICE: in object access: superuser attempting alter (subId=0x0) [explicit without auxiliary object]
NOTICE: in object access: superuser finished alter (subId=0x0) [explicit without auxiliary object]
NOTICE: in process utility: superuser finished ALTER TABLE
ALTER TABLE test_oat_schema.test_oat_tab DISABLE ROW LEVEL SECURITY;
NOTICE: in process utility: superuser attempting ALTER TABLE
NOTICE: in object access: superuser attempting namespace search (subId=0x0) [report on violation, allowed]
NOTICE: in object access: superuser finished namespace search (subId=0x0) [report on violation, allowed]
NOTICE: in object access: superuser attempting alter (subId=0x0) [explicit without auxiliary object]
NOTICE: in object access: superuser finished alter (subId=0x0) [explicit without auxiliary object]
NOTICE: in process utility: superuser finished ALTER TABLE
ALTER TABLE test_oat_schema.test_oat_tab FORCE ROW LEVEL SECURITY;
NOTICE: in process utility: superuser attempting ALTER TABLE
NOTICE: in object access: superuser attempting namespace search (subId=0x0) [report on violation, allowed]
NOTICE: in object access: superuser finished namespace search (subId=0x0) [report on violation, allowed]
NOTICE: in object access: superuser attempting alter (subId=0x0) [explicit without auxiliary object]
NOTICE: in object access: superuser finished alter (subId=0x0) [explicit without auxiliary object]
NOTICE: in process utility: superuser finished ALTER TABLE
ALTER TABLE test_oat_schema.test_oat_tab NO FORCE ROW LEVEL SECURITY;
NOTICE: in process utility: superuser attempting ALTER TABLE
NOTICE: in object access: superuser attempting namespace search (subId=0x0) [report on violation, allowed]
NOTICE: in object access: superuser finished namespace search (subId=0x0) [report on violation, allowed]
NOTICE: in object access: superuser attempting alter (subId=0x0) [explicit without auxiliary object]
NOTICE: in object access: superuser finished alter (subId=0x0) [explicit without auxiliary object]
NOTICE: in process utility: superuser finished ALTER TABLE
-- Rules
ALTER TABLE test_oat_schema.test_oat_tab DISABLE RULE test_oat_notify;
NOTICE: in process utility: superuser attempting ALTER TABLE
NOTICE: in object access: superuser attempting namespace search (subId=0x0) [report on violation, allowed]
NOTICE: in object access: superuser finished namespace search (subId=0x0) [report on violation, allowed]
NOTICE: in object access: superuser attempting alter (subId=0x0) [explicit without auxiliary object]
NOTICE: in object access: superuser finished alter (subId=0x0) [explicit without auxiliary object]
NOTICE: in object access: superuser attempting alter (subId=0x0) [explicit without auxiliary object]
NOTICE: in object access: superuser finished alter (subId=0x0) [explicit without auxiliary object]
NOTICE: in process utility: superuser finished ALTER TABLE
ALTER TABLE test_oat_schema.test_oat_tab ENABLE RULE test_oat_notify;
NOTICE: in process utility: superuser attempting ALTER TABLE
NOTICE: in object access: superuser attempting namespace search (subId=0x0) [report on violation, allowed]
NOTICE: in object access: superuser finished namespace search (subId=0x0) [report on violation, allowed]
NOTICE: in object access: superuser attempting alter (subId=0x0) [explicit without auxiliary object]
NOTICE: in object access: superuser finished alter (subId=0x0) [explicit without auxiliary object]
NOTICE: in object access: superuser attempting alter (subId=0x0) [explicit without auxiliary object]
NOTICE: in object access: superuser finished alter (subId=0x0) [explicit without auxiliary object]
NOTICE: in process utility: superuser finished ALTER TABLE
-- Triggers
ALTER TABLE test_oat_schema.test_oat_tab DISABLE TRIGGER test_oat_trigger;
NOTICE: in process utility: superuser attempting ALTER TABLE
NOTICE: in object access: superuser attempting namespace search (subId=0x0) [report on violation, allowed]
NOTICE: in object access: superuser finished namespace search (subId=0x0) [report on violation, allowed]
NOTICE: in object access: superuser attempting alter (subId=0x0) [explicit without auxiliary object]
NOTICE: in object access: superuser finished alter (subId=0x0) [explicit without auxiliary object]
NOTICE: in object access: superuser attempting alter (subId=0x0) [explicit without auxiliary object]
NOTICE: in object access: superuser finished alter (subId=0x0) [explicit without auxiliary object]
NOTICE: in process utility: superuser finished ALTER TABLE
ALTER TABLE test_oat_schema.test_oat_tab ENABLE TRIGGER test_oat_trigger;
NOTICE: in process utility: superuser attempting ALTER TABLE
NOTICE: in object access: superuser attempting namespace search (subId=0x0) [report on violation, allowed]
NOTICE: in object access: superuser finished namespace search (subId=0x0) [report on violation, allowed]
NOTICE: in object access: superuser attempting alter (subId=0x0) [explicit without auxiliary object]
NOTICE: in object access: superuser finished alter (subId=0x0) [explicit without auxiliary object]
NOTICE: in object access: superuser attempting alter (subId=0x0) [explicit without auxiliary object]
NOTICE: in object access: superuser finished alter (subId=0x0) [explicit without auxiliary object]
NOTICE: in process utility: superuser finished ALTER TABLE
DROP TABLE test_oat_schema.test_oat_tab;
NOTICE: in process utility: superuser attempting DROP TABLE
NOTICE: in object access: superuser attempting namespace search (subId=0x0) [report on violation, allowed]
NOTICE: in object access: superuser finished namespace search (subId=0x0) [report on violation, allowed]
NOTICE: in object access: superuser attempting drop (subId=0x0) []
NOTICE: in object access: superuser finished drop (subId=0x0) []
NOTICE: in object access: superuser attempting drop (subId=0x0) []
NOTICE: in object access: superuser finished drop (subId=0x0) []
NOTICE: in object access: superuser attempting drop (subId=0x0) []
NOTICE: in object access: superuser finished drop (subId=0x0) []
NOTICE: in object access: superuser attempting drop (subId=0x0) []
NOTICE: in object access: superuser finished drop (subId=0x0) []
NOTICE: in object access: superuser attempting drop (subId=0x0) []
NOTICE: in object access: superuser finished drop (subId=0x0) []
NOTICE: in object access: superuser attempting drop (subId=0x0) []
NOTICE: in object access: superuser finished drop (subId=0x0) []
NOTICE: in object access: superuser attempting drop (subId=0x0) []
NOTICE: in object access: superuser finished drop (subId=0x0) []
NOTICE: in process utility: superuser finished DROP TABLE
|