@@ -11,26 +11,26 @@ LOAD 'test_oat_hooks';
11
11
SET test_oat_hooks.audit = true;
12
12
NOTICE: in object_access_hook_str: superuser attempting alter (subId=0x1000, set) [test_oat_hooks.audit]
13
13
NOTICE: 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
15
15
-- Creating privileges on an existent custom GUC should create precisely the
16
16
-- right privileges, not overly conservative ones.
17
17
GRANT 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
20
20
GRANT 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
23
23
-- Granting multiple privileges on a parameter should be reported correctly to
24
24
-- the OAT hook, but beware that WITH GRANT OPTION is not represented.
25
25
GRANT 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
28
28
GRANT 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
31
31
-- Check when the hooks fire relative to dependency based abort of a drop
32
32
DROP ROLE regress_role_joe;
33
- NOTICE: in process utility: superuser attemptingDropRoleStmt
33
+ NOTICE: in process utility: superuser attemptingDROP ROLE
34
34
NOTICE: in object access: superuser attempting drop (subId=0x0) []
35
35
NOTICE: in object access: superuser finished drop (subId=0x0) []
36
36
ERROR: role "regress_role_joe" cannot be dropped because some objects depend on it
@@ -42,30 +42,30 @@ privileges for parameter none.such
42
42
privileges for parameter another.bogus
43
43
-- Check the behavior of the hooks relative to do-nothing grants and revokes
44
44
GRANT 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
47
47
REVOKE 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
50
50
REVOKE 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
53
53
-- Check the behavior of the hooks relative to unrecognized parameters
54
54
GRANT 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
57
57
-- Check relative to an operation that causes the catalog entry to be deleted
58
58
REVOKE 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
61
61
-- Create objects for use in the test
62
62
CREATE USER regress_test_user;
63
- NOTICE: in process utility: superuser attemptingCreateRoleStmt
63
+ NOTICE: in process utility: superuser attemptingCREATE ROLE
64
64
NOTICE: in object access: superuser attempting create (subId=0x0) [explicit]
65
65
NOTICE: in object access: superuser finished create (subId=0x0) [explicit]
66
- NOTICE: in process utility: superuser finishedCreateRoleStmt
66
+ NOTICE: in process utility: superuser finishedCREATE ROLE
67
67
CREATE TABLE regress_test_table (t text);
68
- NOTICE: in process utility: superuser attemptingCreateStmt
68
+ NOTICE: in process utility: superuser attemptingCREATE TABLE
69
69
NOTICE: in object access: superuser attempting namespace search (subId=0x0) [no report on violation, allowed]
70
70
LINE 1: CREATE TABLE regress_test_table (t text);
71
71
^
@@ -82,20 +82,20 @@ NOTICE: in object access: superuser attempting create (subId=0x0) [internal]
82
82
NOTICE: in object access: superuser finished create (subId=0x0) [internal]
83
83
NOTICE: in object access: superuser attempting create (subId=0x0) [internal]
84
84
NOTICE: in object access: superuser finished create (subId=0x0) [internal]
85
- NOTICE: in process utility: superuser finishedCreateStmt
85
+ NOTICE: in process utility: superuser finishedCREATE TABLE
86
86
GRANT SELECT ON Table regress_test_table TO public;
87
- NOTICE: in process utility: superuser attemptingGrantStmt
88
- NOTICE: in process utility: superuser finishedGrantStmt
87
+ NOTICE: in process utility: superuser attemptingGRANT
88
+ NOTICE: in process utility: superuser finishedGRANT
89
89
CREATE FUNCTION regress_test_func (t text) RETURNS text AS $$
90
90
SELECT $1;
91
91
$$ LANGUAGE sql;
92
- NOTICE: in process utility: superuser attemptingCreateFunctionStmt
92
+ NOTICE: in process utility: superuser attemptingCREATE FUNCTION
93
93
NOTICE: in object access: superuser attempting create (subId=0x0) [explicit]
94
94
NOTICE: in object access: superuser finished create (subId=0x0) [explicit]
95
- NOTICE: in process utility: superuser finishedCreateFunctionStmt
95
+ NOTICE: in process utility: superuser finishedCREATE FUNCTION
96
96
GRANT EXECUTE ON FUNCTION regress_test_func (text) TO public;
97
- NOTICE: in process utility: superuser attemptingGrantStmt
98
- NOTICE: in process utility: superuser finishedGrantStmt
97
+ NOTICE: in process utility: superuser attemptingGRANT
98
+ NOTICE: in process utility: superuser finishedGRANT
99
99
-- Do a few things as superuser
100
100
SELECT * FROM regress_test_table;
101
101
NOTICE: in executor check perms: superuser attempting execute
@@ -113,31 +113,31 @@ NOTICE: in executor check perms: superuser finished execute
113
113
(1 row)
114
114
115
115
SET work_mem = 8192;
116
- NOTICE: in process utility: superuser attemptingset
116
+ NOTICE: in process utility: superuser attemptingSET
117
117
NOTICE: in object_access_hook_str: superuser attempting alter (subId=0x1000, set) [work_mem]
118
118
NOTICE: in object_access_hook_str: superuser finished alter (subId=0x1000, set) [work_mem]
119
- NOTICE: in process utility: superuser finishedset
119
+ NOTICE: in process utility: superuser finishedSET
120
120
RESET work_mem;
121
- NOTICE: in process utility: superuser attemptingset
121
+ NOTICE: in process utility: superuser attemptingRESET
122
122
NOTICE: in object_access_hook_str: superuser attempting alter (subId=0x1000, set) [work_mem]
123
123
NOTICE: 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 finishedRESET
125
125
ALTER SYSTEM SET work_mem = 8192;
126
- NOTICE: in process utility: superuser attemptingalter system
126
+ NOTICE: in process utility: superuser attemptingALTER SYSTEM
127
127
NOTICE: in object_access_hook_str: superuser attempting alter (subId=0x2000, alter system) [work_mem]
128
128
NOTICE: in object_access_hook_str: superuser finished alter (subId=0x2000, alter system) [work_mem]
129
- NOTICE: in process utility: superuser finishedalter system
129
+ NOTICE: in process utility: superuser finishedALTER SYSTEM
130
130
ALTER SYSTEM RESET work_mem;
131
- NOTICE: in process utility: superuser attemptingalter system
131
+ NOTICE: in process utility: superuser attemptingALTER SYSTEM
132
132
NOTICE: in object_access_hook_str: superuser attempting alter (subId=0x2000, alter system) [work_mem]
133
133
NOTICE: 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
135
135
-- Do those same things as non-superuser
136
136
SET SESSION AUTHORIZATION regress_test_user;
137
- NOTICE: in process utility: superuser attemptingset
137
+ NOTICE: in process utility: superuser attemptingSET
138
138
NOTICE: in object_access_hook_str: non-superuser attempting alter (subId=0x1000, set) [session_authorization]
139
139
NOTICE: in object_access_hook_str: non-superuser finished alter (subId=0x1000, set) [session_authorization]
140
- NOTICE: in process utility: non-superuser finishedset
140
+ NOTICE: in process utility: non-superuser finishedSET
141
141
SELECT * FROM regress_test_table;
142
142
NOTICE: in object access: non-superuser attempting namespace search (subId=0x0) [no report on violation, allowed]
143
143
LINE 1: SELECT * FROM regress_test_table;
@@ -160,83 +160,83 @@ NOTICE: in executor check perms: non-superuser finished execute
160
160
(1 row)
161
161
162
162
SET work_mem = 8192;
163
- NOTICE: in process utility: non-superuser attemptingset
163
+ NOTICE: in process utility: non-superuser attemptingSET
164
164
NOTICE: in object_access_hook_str: non-superuser attempting alter (subId=0x1000, set) [work_mem]
165
165
NOTICE: in object_access_hook_str: non-superuser finished alter (subId=0x1000, set) [work_mem]
166
- NOTICE: in process utility: non-superuser finishedset
166
+ NOTICE: in process utility: non-superuser finishedSET
167
167
RESET work_mem;
168
- NOTICE: in process utility: non-superuser attemptingset
168
+ NOTICE: in process utility: non-superuser attemptingRESET
169
169
NOTICE: in object_access_hook_str: non-superuser attempting alter (subId=0x1000, set) [work_mem]
170
170
NOTICE: 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 finishedRESET
172
172
ALTER SYSTEM SET work_mem = 8192;
173
- NOTICE: in process utility: non-superuser attemptingalter system
173
+ NOTICE: in process utility: non-superuser attemptingALTER SYSTEM
174
174
ERROR: permission denied to set parameter "work_mem"
175
175
ALTER SYSTEM RESET work_mem;
176
- NOTICE: in process utility: non-superuser attemptingalter system
176
+ NOTICE: in process utility: non-superuser attemptingALTER SYSTEM
177
177
ERROR: permission denied to set parameter "work_mem"
178
178
SET test_oat_hooks.user_var1 = true;
179
- NOTICE: in process utility: non-superuser attemptingset
179
+ NOTICE: in process utility: non-superuser attemptingSET
180
180
NOTICE: in object_access_hook_str: non-superuser attempting alter (subId=0x1000, set) [test_oat_hooks.user_var1]
181
181
NOTICE: in object_access_hook_str: non-superuser finished alter (subId=0x1000, set) [test_oat_hooks.user_var1]
182
- NOTICE: in process utility: non-superuser finishedset
182
+ NOTICE: in process utility: non-superuser finishedSET
183
183
SET test_oat_hooks.super_var1 = true;
184
- NOTICE: in process utility: non-superuser attemptingset
184
+ NOTICE: in process utility: non-superuser attemptingSET
185
185
ERROR: permission denied to set parameter "test_oat_hooks.super_var1"
186
186
ALTER SYSTEM SET test_oat_hooks.user_var1 = true;
187
- NOTICE: in process utility: non-superuser attemptingalter system
187
+ NOTICE: in process utility: non-superuser attemptingALTER SYSTEM
188
188
ERROR: permission denied to set parameter "test_oat_hooks.user_var1"
189
189
ALTER SYSTEM SET test_oat_hooks.super_var1 = true;
190
- NOTICE: in process utility: non-superuser attemptingalter system
190
+ NOTICE: in process utility: non-superuser attemptingALTER SYSTEM
191
191
ERROR: permission denied to set parameter "test_oat_hooks.super_var1"
192
192
SET test_oat_hooks.user_var2 = true;
193
- NOTICE: in process utility: non-superuser attemptingset
193
+ NOTICE: in process utility: non-superuser attemptingSET
194
194
NOTICE: in object_access_hook_str: non-superuser attempting alter (subId=0x1000, set) [test_oat_hooks.user_var2]
195
195
NOTICE: in object_access_hook_str: non-superuser finished alter (subId=0x1000, set) [test_oat_hooks.user_var2]
196
- NOTICE: in process utility: non-superuser finishedset
196
+ NOTICE: in process utility: non-superuser finishedSET
197
197
SET test_oat_hooks.super_var2 = true;
198
- NOTICE: in process utility: non-superuser attemptingset
198
+ NOTICE: in process utility: non-superuser attemptingSET
199
199
ERROR: permission denied to set parameter "test_oat_hooks.super_var2"
200
200
ALTER SYSTEM SET test_oat_hooks.user_var2 = true;
201
- NOTICE: in process utility: non-superuser attemptingalter system
201
+ NOTICE: in process utility: non-superuser attemptingALTER SYSTEM
202
202
ERROR: permission denied to set parameter "test_oat_hooks.user_var2"
203
203
ALTER SYSTEM SET test_oat_hooks.super_var2 = true;
204
- NOTICE: in process utility: non-superuser attemptingalter system
204
+ NOTICE: in process utility: non-superuser attemptingALTER SYSTEM
205
205
ERROR: permission denied to set parameter "test_oat_hooks.super_var2"
206
206
RESET SESSION AUTHORIZATION;
207
- NOTICE: in process utility: non-superuser attemptingset
207
+ NOTICE: in process utility: non-superuser attemptingRESET
208
208
NOTICE: in object_access_hook_str: superuser attempting alter (subId=0x1000, set) [session_authorization]
209
209
NOTICE: in object_access_hook_str: superuser finished alter (subId=0x1000, set) [session_authorization]
210
- NOTICE: in process utility: superuser finishedset
210
+ NOTICE: in process utility: superuser finishedRESET
211
211
-- Turn off non-superuser permissions
212
212
SET test_oat_hooks.deny_set_variable = true;
213
- NOTICE: in process utility: superuser attemptingset
213
+ NOTICE: in process utility: superuser attemptingSET
214
214
NOTICE: in object_access_hook_str: superuser attempting alter (subId=0x1000, set) [test_oat_hooks.deny_set_variable]
215
215
NOTICE: in object_access_hook_str: superuser finished alter (subId=0x1000, set) [test_oat_hooks.deny_set_variable]
216
- NOTICE: in process utility: superuser finishedset
216
+ NOTICE: in process utility: superuser finishedSET
217
217
SET test_oat_hooks.deny_alter_system = true;
218
- NOTICE: in process utility: superuser attemptingset
218
+ NOTICE: in process utility: superuser attemptingSET
219
219
NOTICE: in object_access_hook_str: superuser attempting alter (subId=0x1000, set) [test_oat_hooks.deny_alter_system]
220
220
NOTICE: in object_access_hook_str: superuser finished alter (subId=0x1000, set) [test_oat_hooks.deny_alter_system]
221
- NOTICE: in process utility: superuser finishedset
221
+ NOTICE: in process utility: superuser finishedSET
222
222
SET test_oat_hooks.deny_object_access = true;
223
- NOTICE: in process utility: superuser attemptingset
223
+ NOTICE: in process utility: superuser attemptingSET
224
224
NOTICE: in object_access_hook_str: superuser attempting alter (subId=0x1000, set) [test_oat_hooks.deny_object_access]
225
225
NOTICE: in object_access_hook_str: superuser finished alter (subId=0x1000, set) [test_oat_hooks.deny_object_access]
226
- NOTICE: in process utility: superuser finishedset
226
+ NOTICE: in process utility: superuser finishedSET
227
227
SET test_oat_hooks.deny_exec_perms = true;
228
- NOTICE: in process utility: superuser attemptingset
228
+ NOTICE: in process utility: superuser attemptingSET
229
229
NOTICE: in object_access_hook_str: superuser attempting alter (subId=0x1000, set) [test_oat_hooks.deny_exec_perms]
230
230
NOTICE: in object_access_hook_str: superuser finished alter (subId=0x1000, set) [test_oat_hooks.deny_exec_perms]
231
- NOTICE: in process utility: superuser finishedset
231
+ NOTICE: in process utility: superuser finishedSET
232
232
SET test_oat_hooks.deny_utility_commands = true;
233
- NOTICE: in process utility: superuser attemptingset
233
+ NOTICE: in process utility: superuser attemptingSET
234
234
NOTICE: in object_access_hook_str: superuser attempting alter (subId=0x1000, set) [test_oat_hooks.deny_utility_commands]
235
235
NOTICE: in object_access_hook_str: superuser finished alter (subId=0x1000, set) [test_oat_hooks.deny_utility_commands]
236
- NOTICE: in process utility: superuser finishedset
236
+ NOTICE: in process utility: superuser finishedSET
237
237
-- Try again as non-superuser with permissions denied
238
238
SET SESSION AUTHORIZATION regress_test_user;
239
- NOTICE: in process utility: superuser attemptingset
239
+ NOTICE: in process utility: superuser attemptingSET
240
240
NOTICE: in object_access_hook_str: non-superuser attempting alter (subId=0x1000, set) [session_authorization]
241
241
ERROR: permission denied: set session_authorization
242
242
SELECT * FROM regress_test_table;
@@ -261,33 +261,33 @@ NOTICE: in executor check perms: superuser finished execute
261
261
(1 row)
262
262
263
263
SET work_mem = 8192;
264
- NOTICE: in process utility: superuser attemptingset
264
+ NOTICE: in process utility: superuser attemptingSET
265
265
NOTICE: in object_access_hook_str: superuser attempting alter (subId=0x1000, set) [work_mem]
266
266
NOTICE: in object_access_hook_str: superuser finished alter (subId=0x1000, set) [work_mem]
267
- NOTICE: in process utility: superuser finishedset
267
+ NOTICE: in process utility: superuser finishedSET
268
268
RESET work_mem;
269
- NOTICE: in process utility: superuser attemptingset
269
+ NOTICE: in process utility: superuser attemptingRESET
270
270
NOTICE: in object_access_hook_str: superuser attempting alter (subId=0x1000, set) [work_mem]
271
271
NOTICE: 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 finishedRESET
273
273
ALTER SYSTEM SET work_mem = 8192;
274
- NOTICE: in process utility: superuser attemptingalter system
274
+ NOTICE: in process utility: superuser attemptingALTER SYSTEM
275
275
NOTICE: in object_access_hook_str: superuser attempting alter (subId=0x2000, alter system) [work_mem]
276
276
NOTICE: in object_access_hook_str: superuser finished alter (subId=0x2000, alter system) [work_mem]
277
- NOTICE: in process utility: superuser finishedalter system
277
+ NOTICE: in process utility: superuser finishedALTER SYSTEM
278
278
ALTER SYSTEM RESET work_mem;
279
- NOTICE: in process utility: superuser attemptingalter system
279
+ NOTICE: in process utility: superuser attemptingALTER SYSTEM
280
280
NOTICE: in object_access_hook_str: superuser attempting alter (subId=0x2000, alter system) [work_mem]
281
281
NOTICE: 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
283
283
-- Clean up
284
284
RESET SESSION AUTHORIZATION;
285
- NOTICE: in process utility: superuser attemptingset
285
+ NOTICE: in process utility: superuser attemptingRESET
286
286
NOTICE: in object_access_hook_str: superuser attempting alter (subId=0x1000, set) [session_authorization]
287
287
NOTICE: in object_access_hook_str: superuser finished alter (subId=0x1000, set) [session_authorization]
288
- NOTICE: in process utility: superuser finishedset
288
+ NOTICE: in process utility: superuser finishedRESET
289
289
SET test_oat_hooks.audit = false;
290
- NOTICE: in process utility: superuser attemptingset
290
+ NOTICE: in process utility: superuser attemptingSET
291
291
DROP ROLE regress_role_joe; -- fails
292
292
ERROR: role "regress_role_joe" cannot be dropped because some objects depend on it
293
293
DETAIL: privileges for parameter test_oat_hooks.user_var1