@@ -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 finished set
14+ NOTICE: in process utility: superuser finished SET
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 attempting GrantStmt
19- NOTICE: in process utility: superuser finished GrantStmt
18+ NOTICE: in process utility: superuser attempting GRANT
19+ NOTICE: in process utility: superuser finished GRANT
2020GRANT SET ON PARAMETER test_oat_hooks.super_var2 TO regress_role_joe;
21- NOTICE: in process utility: superuser attempting GrantStmt
22- NOTICE: in process utility: superuser finished GrantStmt
21+ NOTICE: in process utility: superuser attempting GRANT
22+ NOTICE: in process utility: superuser finished GRANT
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 attempting GrantStmt
27- NOTICE: in process utility: superuser finished GrantStmt
26+ NOTICE: in process utility: superuser attempting GRANT
27+ NOTICE: in process utility: superuser finished GRANT
2828GRANT SET, ALTER SYSTEM ON PARAMETER another.bogus TO regress_role_joe WITH GRANT OPTION;
29- NOTICE: in process utility: superuser attempting GrantStmt
30- NOTICE: in process utility: superuser finished GrantStmt
29+ NOTICE: in process utility: superuser attempting GRANT
30+ NOTICE: in process utility: superuser finished GRANT
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 attempting DropRoleStmt
33+ NOTICE: in process utility: superuser attempting DROP 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 attempting GrantStmt
46- NOTICE: in process utility: superuser finished GrantStmt
45+ NOTICE: in process utility: superuser attempting GRANT
46+ NOTICE: in process utility: superuser finished GRANT
4747REVOKE SET ON PARAMETER maintenance_work_mem FROM PUBLIC;
48- NOTICE: in process utility: superuser attempting GrantStmt
49- NOTICE: in process utility: superuser finished GrantStmt
48+ NOTICE: in process utility: superuser attempting REVOKE
49+ NOTICE: in process utility: superuser finished REVOKE
5050REVOKE ALTER SYSTEM ON PARAMETER maintenance_work_mem FROM PUBLIC;
51- NOTICE: in process utility: superuser attempting GrantStmt
52- NOTICE: in process utility: superuser finished GrantStmt
51+ NOTICE: in process utility: superuser attempting REVOKE
52+ NOTICE: in process utility: superuser finished REVOKE
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 attempting GrantStmt
56- NOTICE: in process utility: superuser finished GrantStmt
55+ NOTICE: in process utility: superuser attempting GRANT
56+ NOTICE: in process utility: superuser finished GRANT
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 attempting GrantStmt
60- NOTICE: in process utility: superuser finished GrantStmt
59+ NOTICE: in process utility: superuser attempting REVOKE
60+ NOTICE: in process utility: superuser finished REVOKE
6161-- Create objects for use in the test
6262CREATE USER regress_test_user;
63- NOTICE: in process utility: superuser attempting CreateRoleStmt
63+ NOTICE: in process utility: superuser attempting CREATE 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 finished CreateRoleStmt
66+ NOTICE: in process utility: superuser finished CREATE ROLE
6767CREATE TABLE regress_test_table (t text);
68- NOTICE: in process utility: superuser attempting CreateStmt
68+ NOTICE: in process utility: superuser attempting CREATE 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,20 +82,20 @@ 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 finished CreateStmt
85+ NOTICE: in process utility: superuser finished CREATE TABLE
8686GRANT SELECT ON Table regress_test_table TO public;
87- NOTICE: in process utility: superuser attempting GrantStmt
88- NOTICE: in process utility: superuser finished GrantStmt
87+ NOTICE: in process utility: superuser attempting GRANT
88+ NOTICE: in process utility: superuser finished GRANT
8989CREATE FUNCTION regress_test_func (t text) RETURNS text AS $$
9090 SELECT $1;
9191$$ LANGUAGE sql;
92- NOTICE: in process utility: superuser attempting CreateFunctionStmt
92+ NOTICE: in process utility: superuser attempting CREATE FUNCTION
9393NOTICE: in object access: superuser attempting create (subId=0x0) [explicit]
9494NOTICE: in object access: superuser finished create (subId=0x0) [explicit]
95- NOTICE: in process utility: superuser finished CreateFunctionStmt
95+ NOTICE: in process utility: superuser finished CREATE FUNCTION
9696GRANT EXECUTE ON FUNCTION regress_test_func (text) TO public;
97- NOTICE: in process utility: superuser attempting GrantStmt
98- NOTICE: in process utility: superuser finished GrantStmt
97+ NOTICE: in process utility: superuser attempting GRANT
98+ NOTICE: in process utility: superuser finished GRANT
9999-- Do a few things as superuser
100100SELECT * FROM regress_test_table;
101101NOTICE: in executor check perms: superuser attempting execute
@@ -113,31 +113,31 @@ NOTICE: in executor check perms: superuser finished execute
113113(1 row)
114114
115115SET work_mem = 8192;
116- NOTICE: in process utility: superuser attempting set
116+ NOTICE: in process utility: superuser attempting SET
117117NOTICE: in object_access_hook_str: superuser attempting alter (subId=0x1000, set) [work_mem]
118118NOTICE: in object_access_hook_str: superuser finished alter (subId=0x1000, set) [work_mem]
119- NOTICE: in process utility: superuser finished set
119+ NOTICE: in process utility: superuser finished SET
120120RESET work_mem;
121- NOTICE: in process utility: superuser attempting set
121+ NOTICE: in process utility: superuser attempting RESET
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 finished set
124+ NOTICE: in process utility: superuser finished RESET
125125ALTER SYSTEM SET work_mem = 8192;
126- NOTICE: in process utility: superuser attempting alter system
126+ NOTICE: in process utility: superuser attempting ALTER SYSTEM
127127NOTICE: in object_access_hook_str: superuser attempting alter (subId=0x2000, alter system) [work_mem]
128128NOTICE: in object_access_hook_str: superuser finished alter (subId=0x2000, alter system) [work_mem]
129- NOTICE: in process utility: superuser finished alter system
129+ NOTICE: in process utility: superuser finished ALTER SYSTEM
130130ALTER SYSTEM RESET work_mem;
131- NOTICE: in process utility: superuser attempting alter system
131+ NOTICE: in process utility: superuser attempting ALTER 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 finished alter system
134+ NOTICE: in process utility: superuser finished ALTER SYSTEM
135135-- Do those same things as non-superuser
136136SET SESSION AUTHORIZATION regress_test_user;
137- NOTICE: in process utility: superuser attempting set
137+ NOTICE: in process utility: superuser attempting SET
138138NOTICE: in object_access_hook_str: non-superuser attempting alter (subId=0x1000, set) [session_authorization]
139139NOTICE: in object_access_hook_str: non-superuser finished alter (subId=0x1000, set) [session_authorization]
140- NOTICE: in process utility: non-superuser finished set
140+ NOTICE: in process utility: non-superuser finished SET
141141SELECT * FROM regress_test_table;
142142NOTICE: in object access: non-superuser attempting namespace search (subId=0x0) [no report on violation, allowed]
143143LINE 1: SELECT * FROM regress_test_table;
@@ -160,83 +160,83 @@ NOTICE: in executor check perms: non-superuser finished execute
160160(1 row)
161161
162162SET work_mem = 8192;
163- NOTICE: in process utility: non-superuser attempting set
163+ NOTICE: in process utility: non-superuser attempting SET
164164NOTICE: in object_access_hook_str: non-superuser attempting alter (subId=0x1000, set) [work_mem]
165165NOTICE: in object_access_hook_str: non-superuser finished alter (subId=0x1000, set) [work_mem]
166- NOTICE: in process utility: non-superuser finished set
166+ NOTICE: in process utility: non-superuser finished SET
167167RESET work_mem;
168- NOTICE: in process utility: non-superuser attempting set
168+ NOTICE: in process utility: non-superuser attempting RESET
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 finished set
171+ NOTICE: in process utility: non-superuser finished RESET
172172ALTER SYSTEM SET work_mem = 8192;
173- NOTICE: in process utility: non-superuser attempting alter system
173+ NOTICE: in process utility: non-superuser attempting ALTER SYSTEM
174174ERROR: permission denied to set parameter "work_mem"
175175ALTER SYSTEM RESET work_mem;
176- NOTICE: in process utility: non-superuser attempting alter system
176+ NOTICE: in process utility: non-superuser attempting ALTER SYSTEM
177177ERROR: permission denied to set parameter "work_mem"
178178SET test_oat_hooks.user_var1 = true;
179- NOTICE: in process utility: non-superuser attempting set
179+ NOTICE: in process utility: non-superuser attempting SET
180180NOTICE: in object_access_hook_str: non-superuser attempting alter (subId=0x1000, set) [test_oat_hooks.user_var1]
181181NOTICE: in object_access_hook_str: non-superuser finished alter (subId=0x1000, set) [test_oat_hooks.user_var1]
182- NOTICE: in process utility: non-superuser finished set
182+ NOTICE: in process utility: non-superuser finished SET
183183SET test_oat_hooks.super_var1 = true;
184- NOTICE: in process utility: non-superuser attempting set
184+ NOTICE: in process utility: non-superuser attempting SET
185185ERROR: permission denied to set parameter "test_oat_hooks.super_var1"
186186ALTER SYSTEM SET test_oat_hooks.user_var1 = true;
187- NOTICE: in process utility: non-superuser attempting alter system
187+ NOTICE: in process utility: non-superuser attempting ALTER SYSTEM
188188ERROR: permission denied to set parameter "test_oat_hooks.user_var1"
189189ALTER SYSTEM SET test_oat_hooks.super_var1 = true;
190- NOTICE: in process utility: non-superuser attempting alter system
190+ NOTICE: in process utility: non-superuser attempting ALTER SYSTEM
191191ERROR: permission denied to set parameter "test_oat_hooks.super_var1"
192192SET test_oat_hooks.user_var2 = true;
193- NOTICE: in process utility: non-superuser attempting set
193+ NOTICE: in process utility: non-superuser attempting SET
194194NOTICE: in object_access_hook_str: non-superuser attempting alter (subId=0x1000, set) [test_oat_hooks.user_var2]
195195NOTICE: in object_access_hook_str: non-superuser finished alter (subId=0x1000, set) [test_oat_hooks.user_var2]
196- NOTICE: in process utility: non-superuser finished set
196+ NOTICE: in process utility: non-superuser finished SET
197197SET test_oat_hooks.super_var2 = true;
198- NOTICE: in process utility: non-superuser attempting set
198+ NOTICE: in process utility: non-superuser attempting SET
199199ERROR: permission denied to set parameter "test_oat_hooks.super_var2"
200200ALTER SYSTEM SET test_oat_hooks.user_var2 = true;
201- NOTICE: in process utility: non-superuser attempting alter system
201+ NOTICE: in process utility: non-superuser attempting ALTER SYSTEM
202202ERROR: permission denied to set parameter "test_oat_hooks.user_var2"
203203ALTER SYSTEM SET test_oat_hooks.super_var2 = true;
204- NOTICE: in process utility: non-superuser attempting alter system
204+ NOTICE: in process utility: non-superuser attempting ALTER SYSTEM
205205ERROR: permission denied to set parameter "test_oat_hooks.super_var2"
206206RESET SESSION AUTHORIZATION;
207- NOTICE: in process utility: non-superuser attempting set
207+ NOTICE: in process utility: non-superuser attempting RESET
208208NOTICE: in object_access_hook_str: superuser attempting alter (subId=0x1000, set) [session_authorization]
209209NOTICE: in object_access_hook_str: superuser finished alter (subId=0x1000, set) [session_authorization]
210- NOTICE: in process utility: superuser finished set
210+ NOTICE: in process utility: superuser finished RESET
211211-- Turn off non-superuser permissions
212212SET test_oat_hooks.deny_set_variable = true;
213- NOTICE: in process utility: superuser attempting set
213+ NOTICE: in process utility: superuser attempting SET
214214NOTICE: in object_access_hook_str: superuser attempting alter (subId=0x1000, set) [test_oat_hooks.deny_set_variable]
215215NOTICE: in object_access_hook_str: superuser finished alter (subId=0x1000, set) [test_oat_hooks.deny_set_variable]
216- NOTICE: in process utility: superuser finished set
216+ NOTICE: in process utility: superuser finished SET
217217SET test_oat_hooks.deny_alter_system = true;
218- NOTICE: in process utility: superuser attempting set
218+ NOTICE: in process utility: superuser attempting SET
219219NOTICE: in object_access_hook_str: superuser attempting alter (subId=0x1000, set) [test_oat_hooks.deny_alter_system]
220220NOTICE: in object_access_hook_str: superuser finished alter (subId=0x1000, set) [test_oat_hooks.deny_alter_system]
221- NOTICE: in process utility: superuser finished set
221+ NOTICE: in process utility: superuser finished SET
222222SET test_oat_hooks.deny_object_access = true;
223- NOTICE: in process utility: superuser attempting set
223+ NOTICE: in process utility: superuser attempting SET
224224NOTICE: in object_access_hook_str: superuser attempting alter (subId=0x1000, set) [test_oat_hooks.deny_object_access]
225225NOTICE: in object_access_hook_str: superuser finished alter (subId=0x1000, set) [test_oat_hooks.deny_object_access]
226- NOTICE: in process utility: superuser finished set
226+ NOTICE: in process utility: superuser finished SET
227227SET test_oat_hooks.deny_exec_perms = true;
228- NOTICE: in process utility: superuser attempting set
228+ NOTICE: in process utility: superuser attempting SET
229229NOTICE: in object_access_hook_str: superuser attempting alter (subId=0x1000, set) [test_oat_hooks.deny_exec_perms]
230230NOTICE: in object_access_hook_str: superuser finished alter (subId=0x1000, set) [test_oat_hooks.deny_exec_perms]
231- NOTICE: in process utility: superuser finished set
231+ NOTICE: in process utility: superuser finished SET
232232SET test_oat_hooks.deny_utility_commands = true;
233- NOTICE: in process utility: superuser attempting set
233+ NOTICE: in process utility: superuser attempting SET
234234NOTICE: in object_access_hook_str: superuser attempting alter (subId=0x1000, set) [test_oat_hooks.deny_utility_commands]
235235NOTICE: in object_access_hook_str: superuser finished alter (subId=0x1000, set) [test_oat_hooks.deny_utility_commands]
236- NOTICE: in process utility: superuser finished set
236+ NOTICE: in process utility: superuser finished SET
237237-- Try again as non-superuser with permissions denied
238238SET SESSION AUTHORIZATION regress_test_user;
239- NOTICE: in process utility: superuser attempting set
239+ NOTICE: in process utility: superuser attempting SET
240240NOTICE: in object_access_hook_str: non-superuser attempting alter (subId=0x1000, set) [session_authorization]
241241ERROR: permission denied: set session_authorization
242242SELECT * FROM regress_test_table;
@@ -261,33 +261,33 @@ NOTICE: in executor check perms: superuser finished execute
261261(1 row)
262262
263263SET work_mem = 8192;
264- NOTICE: in process utility: superuser attempting set
264+ NOTICE: in process utility: superuser attempting SET
265265NOTICE: in object_access_hook_str: superuser attempting alter (subId=0x1000, set) [work_mem]
266266NOTICE: in object_access_hook_str: superuser finished alter (subId=0x1000, set) [work_mem]
267- NOTICE: in process utility: superuser finished set
267+ NOTICE: in process utility: superuser finished SET
268268RESET work_mem;
269- NOTICE: in process utility: superuser attempting set
269+ NOTICE: in process utility: superuser attempting RESET
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 finished set
272+ NOTICE: in process utility: superuser finished RESET
273273ALTER SYSTEM SET work_mem = 8192;
274- NOTICE: in process utility: superuser attempting alter system
274+ NOTICE: in process utility: superuser attempting ALTER SYSTEM
275275NOTICE: in object_access_hook_str: superuser attempting alter (subId=0x2000, alter system) [work_mem]
276276NOTICE: in object_access_hook_str: superuser finished alter (subId=0x2000, alter system) [work_mem]
277- NOTICE: in process utility: superuser finished alter system
277+ NOTICE: in process utility: superuser finished ALTER SYSTEM
278278ALTER SYSTEM RESET work_mem;
279- NOTICE: in process utility: superuser attempting alter system
279+ NOTICE: in process utility: superuser attempting ALTER 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 finished alter system
282+ NOTICE: in process utility: superuser finished ALTER SYSTEM
283283-- Clean up
284284RESET SESSION AUTHORIZATION;
285- NOTICE: in process utility: superuser attempting set
285+ NOTICE: in process utility: superuser attempting RESET
286286NOTICE: in object_access_hook_str: superuser attempting alter (subId=0x1000, set) [session_authorization]
287287NOTICE: in object_access_hook_str: superuser finished alter (subId=0x1000, set) [session_authorization]
288- NOTICE: in process utility: superuser finished set
288+ NOTICE: in process utility: superuser finished RESET
289289SET test_oat_hooks.audit = false;
290- NOTICE: in process utility: superuser attempting set
290+ NOTICE: in process utility: superuser attempting SET
291291DROP ROLE regress_role_joe; -- fails
292292ERROR: role "regress_role_joe" cannot be dropped because some objects depend on it
293293DETAIL: privileges for parameter test_oat_hooks.user_var1
0 commit comments