@@ -11,26 +11,26 @@ LOAD 'test_oat_hooks';
1111SET test_oat_hooks.audit = true;
1212NOTICE: in object_access_hook_str: superuser attempting alter (subId=0x1000, set) [test_oat_hooks.audit]
1313NOTICE: in object_access_hook_str: superuser finished alter (subId=0x1000, set) [test_oat_hooks.audit]
14- NOTICE: in process utility: superuser finishedset
14+ NOTICE: in process utility: superuser finishedSET
1515-- Creating privileges on an existent custom GUC should create precisely the
1616-- right privileges, not overly conservative ones.
1717GRANT SET ON PARAMETER test_oat_hooks.user_var2 TO regress_role_joe;
18- NOTICE: in process utility: superuser attemptingGrantStmt
19- NOTICE: in process utility: superuser finishedGrantStmt
18+ NOTICE: in process utility: superuser attemptingGRANT
19+ NOTICE: in process utility: superuser finishedGRANT
2020GRANT SET ON PARAMETER test_oat_hooks.super_var2 TO regress_role_joe;
21- NOTICE: in process utility: superuser attemptingGrantStmt
22- NOTICE: in process utility: superuser finishedGrantStmt
21+ NOTICE: in process utility: superuser attemptingGRANT
22+ NOTICE: in process utility: superuser finishedGRANT
2323-- Granting multiple privileges on a parameter should be reported correctly to
2424-- the OAT hook, but beware that WITH GRANT OPTION is not represented.
2525GRANT SET, ALTER SYSTEM ON PARAMETER none.such TO regress_role_joe;
26- NOTICE: in process utility: superuser attemptingGrantStmt
27- NOTICE: in process utility: superuser finishedGrantStmt
26+ NOTICE: in process utility: superuser attemptingGRANT
27+ NOTICE: in process utility: superuser finishedGRANT
2828GRANT SET, ALTER SYSTEM ON PARAMETER another.bogus TO regress_role_joe WITH GRANT OPTION;
29- NOTICE: in process utility: superuser attemptingGrantStmt
30- NOTICE: in process utility: superuser finishedGrantStmt
29+ NOTICE: in process utility: superuser attemptingGRANT
30+ NOTICE: in process utility: superuser finishedGRANT
3131-- Check when the hooks fire relative to dependency based abort of a drop
3232DROP ROLE regress_role_joe;
33- NOTICE: in process utility: superuser attemptingDropRoleStmt
33+ NOTICE: in process utility: superuser attemptingDROP ROLE
3434NOTICE: in object access: superuser attempting drop (subId=0x0) []
3535NOTICE: in object access: superuser finished drop (subId=0x0) []
3636ERROR: role "regress_role_joe" cannot be dropped because some objects depend on it
@@ -42,30 +42,30 @@ privileges for parameter none.such
4242privileges for parameter another.bogus
4343-- Check the behavior of the hooks relative to do-nothing grants and revokes
4444GRANT SET ON PARAMETER maintenance_work_mem TO PUBLIC;
45- NOTICE: in process utility: superuser attemptingGrantStmt
46- NOTICE: in process utility: superuser finishedGrantStmt
45+ NOTICE: in process utility: superuser attemptingGRANT
46+ NOTICE: in process utility: superuser finishedGRANT
4747REVOKE SET ON PARAMETER maintenance_work_mem FROM PUBLIC;
48- NOTICE: in process utility: superuser attemptingGrantStmt
49- NOTICE: in process utility: superuser finishedGrantStmt
48+ NOTICE: in process utility: superuser attemptingREVOKE
49+ NOTICE: in process utility: superuser finishedREVOKE
5050REVOKE ALTER SYSTEM ON PARAMETER maintenance_work_mem FROM PUBLIC;
51- NOTICE: in process utility: superuser attemptingGrantStmt
52- NOTICE: in process utility: superuser finishedGrantStmt
51+ NOTICE: in process utility: superuser attemptingREVOKE
52+ NOTICE: in process utility: superuser finishedREVOKE
5353-- Check the behavior of the hooks relative to unrecognized parameters
5454GRANT ALL ON PARAMETER "none.such" TO PUBLIC;
55- NOTICE: in process utility: superuser attemptingGrantStmt
56- NOTICE: in process utility: superuser finishedGrantStmt
55+ NOTICE: in process utility: superuser attemptingGRANT
56+ NOTICE: in process utility: superuser finishedGRANT
5757-- Check relative to an operation that causes the catalog entry to be deleted
5858REVOKE ALL ON PARAMETER "none.such" FROM PUBLIC;
59- NOTICE: in process utility: superuser attemptingGrantStmt
60- NOTICE: in process utility: superuser finishedGrantStmt
59+ NOTICE: in process utility: superuser attemptingREVOKE
60+ NOTICE: in process utility: superuser finishedREVOKE
6161-- Create objects for use in the test
6262CREATE USER regress_test_user;
63- NOTICE: in process utility: superuser attemptingCreateRoleStmt
63+ NOTICE: in process utility: superuser attemptingCREATE ROLE
6464NOTICE: in object access: superuser attempting create (subId=0x0) [explicit]
6565NOTICE: in object access: superuser finished create (subId=0x0) [explicit]
66- NOTICE: in process utility: superuser finishedCreateRoleStmt
66+ NOTICE: in process utility: superuser finishedCREATE ROLE
6767CREATE TABLE regress_test_table (t text);
68- NOTICE: in process utility: superuser attemptingCreateStmt
68+ NOTICE: in process utility: superuser attemptingCREATE TABLE
6969NOTICE: in object access: superuser attempting namespace search (subId=0x0) [no report on violation, allowed]
7070LINE 1: CREATE TABLE regress_test_table (t text);
7171 ^
@@ -82,25 +82,25 @@ NOTICE: in object access: superuser attempting create (subId=0x0) [internal]
8282NOTICE: in object access: superuser finished create (subId=0x0) [internal]
8383NOTICE: in object access: superuser attempting create (subId=0x0) [internal]
8484NOTICE: in object access: superuser finished create (subId=0x0) [internal]
85- NOTICE: in process utility: superuser finishedCreateStmt
85+ NOTICE: in process utility: superuser finishedCREATE TABLE
8686CREATE INDEX regress_test_table_t_idx ON regress_test_table (t);
87- NOTICE: in process utility: superuser attemptingIndexStmt
87+ NOTICE: in process utility: superuser attemptingCREATE INDEX
8888NOTICE: in object access: superuser attempting create (subId=0x0) [explicit]
8989NOTICE: in object access: superuser finished create (subId=0x0) [explicit]
90- NOTICE: in process utility: superuser finishedIndexStmt
90+ NOTICE: in process utility: superuser finishedCREATE INDEX
9191GRANT SELECT ON Table regress_test_table TO public;
92- NOTICE: in process utility: superuser attemptingGrantStmt
93- NOTICE: in process utility: superuser finishedGrantStmt
92+ NOTICE: in process utility: superuser attemptingGRANT
93+ NOTICE: in process utility: superuser finishedGRANT
9494CREATE FUNCTION regress_test_func (t text) RETURNS text AS $$
9595SELECT $1;
9696$$ LANGUAGE sql;
97- NOTICE: in process utility: superuser attemptingCreateFunctionStmt
97+ NOTICE: in process utility: superuser attemptingCREATE FUNCTION
9898NOTICE: in object access: superuser attempting create (subId=0x0) [explicit]
9999NOTICE: in object access: superuser finished create (subId=0x0) [explicit]
100- NOTICE: in process utility: superuser finishedCreateFunctionStmt
100+ NOTICE: in process utility: superuser finishedCREATE FUNCTION
101101GRANT EXECUTE ON FUNCTION regress_test_func (text) TO public;
102- NOTICE: in process utility: superuser attemptingGrantStmt
103- NOTICE: in process utility: superuser finishedGrantStmt
102+ NOTICE: in process utility: superuser attemptingGRANT
103+ NOTICE: in process utility: superuser finishedGRANT
104104-- Do a few things as superuser
105105SELECT * FROM regress_test_table;
106106NOTICE: in executor check perms: superuser attempting execute
@@ -118,31 +118,31 @@ NOTICE: in executor check perms: superuser finished execute
118118(1 row)
119119
120120SET work_mem = 8192;
121- NOTICE: in process utility: superuser attemptingset
121+ NOTICE: in process utility: superuser attemptingSET
122122NOTICE: in object_access_hook_str: superuser attempting alter (subId=0x1000, set) [work_mem]
123123NOTICE: in object_access_hook_str: superuser finished alter (subId=0x1000, set) [work_mem]
124- NOTICE: in process utility: superuser finishedset
124+ NOTICE: in process utility: superuser finishedSET
125125RESET work_mem;
126- NOTICE: in process utility: superuser attemptingset
126+ NOTICE: in process utility: superuser attemptingRESET
127127NOTICE: in object_access_hook_str: superuser attempting alter (subId=0x1000, set) [work_mem]
128128NOTICE: in object_access_hook_str: superuser finished alter (subId=0x1000, set) [work_mem]
129- NOTICE: in process utility: superuser finishedset
129+ NOTICE: in process utility: superuser finishedRESET
130130ALTER SYSTEM SET work_mem = 8192;
131- NOTICE: in process utility: superuser attemptingalter system
131+ NOTICE: in process utility: superuser attemptingALTER SYSTEM
132132NOTICE: in object_access_hook_str: superuser attempting alter (subId=0x2000, alter system) [work_mem]
133133NOTICE: in object_access_hook_str: superuser finished alter (subId=0x2000, alter system) [work_mem]
134- NOTICE: in process utility: superuser finishedalter system
134+ NOTICE: in process utility: superuser finishedALTER SYSTEM
135135ALTER SYSTEM RESET work_mem;
136- NOTICE: in process utility: superuser attemptingalter system
136+ NOTICE: in process utility: superuser attemptingALTER SYSTEM
137137NOTICE: in object_access_hook_str: superuser attempting alter (subId=0x2000, alter system) [work_mem]
138138NOTICE: in object_access_hook_str: superuser finished alter (subId=0x2000, alter system) [work_mem]
139- NOTICE: in process utility: superuser finishedalter system
139+ NOTICE: in process utility: superuser finishedALTER SYSTEM
140140-- Do those same things as non-superuser
141141SET SESSION AUTHORIZATION regress_test_user;
142- NOTICE: in process utility: superuser attemptingset
142+ NOTICE: in process utility: superuser attemptingSET
143143NOTICE: in object_access_hook_str: non-superuser attempting alter (subId=0x1000, set) [session_authorization]
144144NOTICE: in object_access_hook_str: non-superuser finished alter (subId=0x1000, set) [session_authorization]
145- NOTICE: in process utility: non-superuser finishedset
145+ NOTICE: in process utility: non-superuser finishedSET
146146SELECT * FROM regress_test_table;
147147NOTICE: in object access: non-superuser attempting namespace search (subId=0x0) [no report on violation, allowed]
148148LINE 1: SELECT * FROM regress_test_table;
@@ -165,83 +165,83 @@ NOTICE: in executor check perms: non-superuser finished execute
165165(1 row)
166166
167167SET work_mem = 8192;
168- NOTICE: in process utility: non-superuser attemptingset
168+ NOTICE: in process utility: non-superuser attemptingSET
169169NOTICE: in object_access_hook_str: non-superuser attempting alter (subId=0x1000, set) [work_mem]
170170NOTICE: in object_access_hook_str: non-superuser finished alter (subId=0x1000, set) [work_mem]
171- NOTICE: in process utility: non-superuser finishedset
171+ NOTICE: in process utility: non-superuser finishedSET
172172RESET work_mem;
173- NOTICE: in process utility: non-superuser attemptingset
173+ NOTICE: in process utility: non-superuser attemptingRESET
174174NOTICE: in object_access_hook_str: non-superuser attempting alter (subId=0x1000, set) [work_mem]
175175NOTICE: in object_access_hook_str: non-superuser finished alter (subId=0x1000, set) [work_mem]
176- NOTICE: in process utility: non-superuser finishedset
176+ NOTICE: in process utility: non-superuser finishedRESET
177177ALTER SYSTEM SET work_mem = 8192;
178- NOTICE: in process utility: non-superuser attemptingalter system
178+ NOTICE: in process utility: non-superuser attemptingALTER SYSTEM
179179ERROR: permission denied to set parameter "work_mem"
180180ALTER SYSTEM RESET work_mem;
181- NOTICE: in process utility: non-superuser attemptingalter system
181+ NOTICE: in process utility: non-superuser attemptingALTER SYSTEM
182182ERROR: permission denied to set parameter "work_mem"
183183SET test_oat_hooks.user_var1 = true;
184- NOTICE: in process utility: non-superuser attemptingset
184+ NOTICE: in process utility: non-superuser attemptingSET
185185NOTICE: in object_access_hook_str: non-superuser attempting alter (subId=0x1000, set) [test_oat_hooks.user_var1]
186186NOTICE: in object_access_hook_str: non-superuser finished alter (subId=0x1000, set) [test_oat_hooks.user_var1]
187- NOTICE: in process utility: non-superuser finishedset
187+ NOTICE: in process utility: non-superuser finishedSET
188188SET test_oat_hooks.super_var1 = true;
189- NOTICE: in process utility: non-superuser attemptingset
189+ NOTICE: in process utility: non-superuser attemptingSET
190190ERROR: permission denied to set parameter "test_oat_hooks.super_var1"
191191ALTER SYSTEM SET test_oat_hooks.user_var1 = true;
192- NOTICE: in process utility: non-superuser attemptingalter system
192+ NOTICE: in process utility: non-superuser attemptingALTER SYSTEM
193193ERROR: permission denied to set parameter "test_oat_hooks.user_var1"
194194ALTER SYSTEM SET test_oat_hooks.super_var1 = true;
195- NOTICE: in process utility: non-superuser attemptingalter system
195+ NOTICE: in process utility: non-superuser attemptingALTER SYSTEM
196196ERROR: permission denied to set parameter "test_oat_hooks.super_var1"
197197SET test_oat_hooks.user_var2 = true;
198- NOTICE: in process utility: non-superuser attemptingset
198+ NOTICE: in process utility: non-superuser attemptingSET
199199NOTICE: in object_access_hook_str: non-superuser attempting alter (subId=0x1000, set) [test_oat_hooks.user_var2]
200200NOTICE: in object_access_hook_str: non-superuser finished alter (subId=0x1000, set) [test_oat_hooks.user_var2]
201- NOTICE: in process utility: non-superuser finishedset
201+ NOTICE: in process utility: non-superuser finishedSET
202202SET test_oat_hooks.super_var2 = true;
203- NOTICE: in process utility: non-superuser attemptingset
203+ NOTICE: in process utility: non-superuser attemptingSET
204204ERROR: permission denied to set parameter "test_oat_hooks.super_var2"
205205ALTER SYSTEM SET test_oat_hooks.user_var2 = true;
206- NOTICE: in process utility: non-superuser attemptingalter system
206+ NOTICE: in process utility: non-superuser attemptingALTER SYSTEM
207207ERROR: permission denied to set parameter "test_oat_hooks.user_var2"
208208ALTER SYSTEM SET test_oat_hooks.super_var2 = true;
209- NOTICE: in process utility: non-superuser attemptingalter system
209+ NOTICE: in process utility: non-superuser attemptingALTER SYSTEM
210210ERROR: permission denied to set parameter "test_oat_hooks.super_var2"
211211RESET SESSION AUTHORIZATION;
212- NOTICE: in process utility: non-superuser attemptingset
212+ NOTICE: in process utility: non-superuser attemptingRESET
213213NOTICE: in object_access_hook_str: superuser attempting alter (subId=0x1000, set) [session_authorization]
214214NOTICE: in object_access_hook_str: superuser finished alter (subId=0x1000, set) [session_authorization]
215- NOTICE: in process utility: superuser finishedset
215+ NOTICE: in process utility: superuser finishedRESET
216216-- Turn off non-superuser permissions
217217SET test_oat_hooks.deny_set_variable = true;
218- NOTICE: in process utility: superuser attemptingset
218+ NOTICE: in process utility: superuser attemptingSET
219219NOTICE: in object_access_hook_str: superuser attempting alter (subId=0x1000, set) [test_oat_hooks.deny_set_variable]
220220NOTICE: in object_access_hook_str: superuser finished alter (subId=0x1000, set) [test_oat_hooks.deny_set_variable]
221- NOTICE: in process utility: superuser finishedset
221+ NOTICE: in process utility: superuser finishedSET
222222SET test_oat_hooks.deny_alter_system = true;
223- NOTICE: in process utility: superuser attemptingset
223+ NOTICE: in process utility: superuser attemptingSET
224224NOTICE: in object_access_hook_str: superuser attempting alter (subId=0x1000, set) [test_oat_hooks.deny_alter_system]
225225NOTICE: in object_access_hook_str: superuser finished alter (subId=0x1000, set) [test_oat_hooks.deny_alter_system]
226- NOTICE: in process utility: superuser finishedset
226+ NOTICE: in process utility: superuser finishedSET
227227SET test_oat_hooks.deny_object_access = true;
228- NOTICE: in process utility: superuser attemptingset
228+ NOTICE: in process utility: superuser attemptingSET
229229NOTICE: in object_access_hook_str: superuser attempting alter (subId=0x1000, set) [test_oat_hooks.deny_object_access]
230230NOTICE: in object_access_hook_str: superuser finished alter (subId=0x1000, set) [test_oat_hooks.deny_object_access]
231- NOTICE: in process utility: superuser finishedset
231+ NOTICE: in process utility: superuser finishedSET
232232SET test_oat_hooks.deny_exec_perms = true;
233- NOTICE: in process utility: superuser attemptingset
233+ NOTICE: in process utility: superuser attemptingSET
234234NOTICE: in object_access_hook_str: superuser attempting alter (subId=0x1000, set) [test_oat_hooks.deny_exec_perms]
235235NOTICE: in object_access_hook_str: superuser finished alter (subId=0x1000, set) [test_oat_hooks.deny_exec_perms]
236- NOTICE: in process utility: superuser finishedset
236+ NOTICE: in process utility: superuser finishedSET
237237SET test_oat_hooks.deny_utility_commands = true;
238- NOTICE: in process utility: superuser attemptingset
238+ NOTICE: in process utility: superuser attemptingSET
239239NOTICE: in object_access_hook_str: superuser attempting alter (subId=0x1000, set) [test_oat_hooks.deny_utility_commands]
240240NOTICE: in object_access_hook_str: superuser finished alter (subId=0x1000, set) [test_oat_hooks.deny_utility_commands]
241- NOTICE: in process utility: superuser finishedset
241+ NOTICE: in process utility: superuser finishedSET
242242-- Try again as non-superuser with permissions denied
243243SET SESSION AUTHORIZATION regress_test_user;
244- NOTICE: in process utility: superuser attemptingset
244+ NOTICE: in process utility: superuser attemptingSET
245245NOTICE: in object_access_hook_str: non-superuser attempting alter (subId=0x1000, set) [session_authorization]
246246ERROR: permission denied: set session_authorization
247247SELECT * FROM regress_test_table;
@@ -266,39 +266,39 @@ NOTICE: in executor check perms: superuser finished execute
266266(1 row)
267267
268268SET work_mem = 8192;
269- NOTICE: in process utility: superuser attemptingset
269+ NOTICE: in process utility: superuser attemptingSET
270270NOTICE: in object_access_hook_str: superuser attempting alter (subId=0x1000, set) [work_mem]
271271NOTICE: in object_access_hook_str: superuser finished alter (subId=0x1000, set) [work_mem]
272- NOTICE: in process utility: superuser finishedset
272+ NOTICE: in process utility: superuser finishedSET
273273RESET work_mem;
274- NOTICE: in process utility: superuser attemptingset
274+ NOTICE: in process utility: superuser attemptingRESET
275275NOTICE: in object_access_hook_str: superuser attempting alter (subId=0x1000, set) [work_mem]
276276NOTICE: in object_access_hook_str: superuser finished alter (subId=0x1000, set) [work_mem]
277- NOTICE: in process utility: superuser finishedset
277+ NOTICE: in process utility: superuser finishedRESET
278278ALTER SYSTEM SET work_mem = 8192;
279- NOTICE: in process utility: superuser attemptingalter system
279+ NOTICE: in process utility: superuser attemptingALTER SYSTEM
280280NOTICE: in object_access_hook_str: superuser attempting alter (subId=0x2000, alter system) [work_mem]
281281NOTICE: in object_access_hook_str: superuser finished alter (subId=0x2000, alter system) [work_mem]
282- NOTICE: in process utility: superuser finishedalter system
282+ NOTICE: in process utility: superuser finishedALTER SYSTEM
283283ALTER SYSTEM RESET work_mem;
284- NOTICE: in process utility: superuser attemptingalter system
284+ NOTICE: in process utility: superuser attemptingALTER SYSTEM
285285NOTICE: in object_access_hook_str: superuser attempting alter (subId=0x2000, alter system) [work_mem]
286286NOTICE: in object_access_hook_str: superuser finished alter (subId=0x2000, alter system) [work_mem]
287- NOTICE: in process utility: superuser finishedalter system
287+ NOTICE: in process utility: superuser finishedALTER SYSTEM
288288-- try labelled drops
289289RESET SESSION AUTHORIZATION;
290- NOTICE: in process utility: superuser attemptingset
290+ NOTICE: in process utility: superuser attemptingRESET
291291NOTICE: in object_access_hook_str: superuser attempting alter (subId=0x1000, set) [session_authorization]
292292NOTICE: in object_access_hook_str: superuser finished alter (subId=0x1000, set) [session_authorization]
293- NOTICE: in process utility: superuser finishedset
293+ NOTICE: in process utility: superuser finishedRESET
294294DROP INDEX CONCURRENTLY regress_test_table_t_idx;
295- NOTICE: in process utility: superuser attemptingDropStmt
295+ NOTICE: in process utility: superuser attemptingDROP INDEX
296296NOTICE: in object access: superuser attempting drop (subId=0x0) [concurrent drop,]
297297NOTICE: in object access: superuser finished drop (subId=0x0) [concurrent drop,]
298- NOTICE: in process utility: superuser finishedDropStmt
298+ NOTICE: in process utility: superuser finishedDROP INDEX
299299-- Clean up
300300SET test_oat_hooks.audit = false;
301- NOTICE: in process utility: superuser attemptingset
301+ NOTICE: in process utility: superuser attemptingSET
302302DROP ROLE regress_role_joe; -- fails
303303ERROR: role "regress_role_joe" cannot be dropped because some objects depend on it
304304DETAIL: privileges for parameter test_oat_hooks.user_var1