Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3451a57

Browse files
committed
Remove test_oat_hooks.c's nodetag_to_string().
In the short time this function has existed, it's already proven to bea nontrivial maintenance burden, since it has to be updated whenever anode tag is added or removed. Although in principle we could nowautomate that, I see little justification for having such functionalityhere at all. The function is only being applied to utility statements,for which we already have infrastructure for obtaining string names.Moreover, that infrastructure produces already-familiar-to-users names,unlike nodetag_to_string().So, remove this function and use the existing infrastructure instead.That saves over a thousand lines of largely-unreachable code.Back-patch to v15 where this code came in. Although it seems unlikelythat v15's nodetag list will change anymore, we might as well keep thetwo branches looking and acting alike; otherwise back-patching anytest-results changes in this area will be painful.Discussion:https://postgr.es/m/843818.1659218928@sss.pgh.pa.us
1 parent7781f4e commit3451a57

File tree

2 files changed

+85
-1402
lines changed

2 files changed

+85
-1402
lines changed

‎src/test/modules/test_oat_hooks/expected/test_oat_hooks.out

Lines changed: 84 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,26 @@ LOAD 'test_oat_hooks';
1111
SET test_oat_hooks.audit = true;
1212
NOTICE: in object_access_hook_str: superuser attempting alter (subId=0x1000, set) [test_oat_hooks.audit]
1313
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
1515
-- Creating privileges on an existent custom GUC should create precisely the
1616
-- right privileges, not overly conservative ones.
1717
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
2020
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
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.
2525
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
2828
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
3131
-- Check when the hooks fire relative to dependency based abort of a drop
3232
DROP ROLE regress_role_joe;
33-
NOTICE: in process utility: superuser attemptingDropRoleStmt
33+
NOTICE: in process utility: superuser attemptingDROP ROLE
3434
NOTICE: in object access: superuser attempting drop (subId=0x0) []
3535
NOTICE: in object access: superuser finished drop (subId=0x0) []
3636
ERROR: role "regress_role_joe" cannot be dropped because some objects depend on it
@@ -42,30 +42,30 @@ privileges for parameter none.such
4242
privileges for parameter another.bogus
4343
-- Check the behavior of the hooks relative to do-nothing grants and revokes
4444
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
4747
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
5050
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
5353
-- Check the behavior of the hooks relative to unrecognized parameters
5454
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
5757
-- Check relative to an operation that causes the catalog entry to be deleted
5858
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
6161
-- Create objects for use in the test
6262
CREATE USER regress_test_user;
63-
NOTICE: in process utility: superuser attemptingCreateRoleStmt
63+
NOTICE: in process utility: superuser attemptingCREATE ROLE
6464
NOTICE: in object access: superuser attempting create (subId=0x0) [explicit]
6565
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
6767
CREATE TABLE regress_test_table (t text);
68-
NOTICE: in process utility: superuser attemptingCreateStmt
68+
NOTICE: in process utility: superuser attemptingCREATE TABLE
6969
NOTICE: in object access: superuser attempting namespace search (subId=0x0) [no report on violation, allowed]
7070
LINE 1: CREATE TABLE regress_test_table (t text);
7171
^
@@ -82,25 +82,25 @@ NOTICE: in object access: superuser attempting create (subId=0x0) [internal]
8282
NOTICE: in object access: superuser finished create (subId=0x0) [internal]
8383
NOTICE: in object access: superuser attempting create (subId=0x0) [internal]
8484
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
8686
CREATE 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
8888
NOTICE: in object access: superuser attempting create (subId=0x0) [explicit]
8989
NOTICE: in object access: superuser finished create (subId=0x0) [explicit]
90-
NOTICE: in process utility: superuser finishedIndexStmt
90+
NOTICE: in process utility: superuser finishedCREATE INDEX
9191
GRANT 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
9494
CREATE FUNCTION regress_test_func (t text) RETURNS text AS $$
9595
SELECT $1;
9696
$$ LANGUAGE sql;
97-
NOTICE: in process utility: superuser attemptingCreateFunctionStmt
97+
NOTICE: in process utility: superuser attemptingCREATE FUNCTION
9898
NOTICE: in object access: superuser attempting create (subId=0x0) [explicit]
9999
NOTICE: in object access: superuser finished create (subId=0x0) [explicit]
100-
NOTICE: in process utility: superuser finishedCreateFunctionStmt
100+
NOTICE: in process utility: superuser finishedCREATE FUNCTION
101101
GRANT 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
105105
SELECT * FROM regress_test_table;
106106
NOTICE: in executor check perms: superuser attempting execute
@@ -118,31 +118,31 @@ NOTICE: in executor check perms: superuser finished execute
118118
(1 row)
119119

120120
SET work_mem = 8192;
121-
NOTICE: in process utility: superuser attemptingset
121+
NOTICE: in process utility: superuser attemptingSET
122122
NOTICE: in object_access_hook_str: superuser attempting alter (subId=0x1000, set) [work_mem]
123123
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 finishedSET
125125
RESET work_mem;
126-
NOTICE: in process utility: superuser attemptingset
126+
NOTICE: in process utility: superuser attemptingRESET
127127
NOTICE: in object_access_hook_str: superuser attempting alter (subId=0x1000, set) [work_mem]
128128
NOTICE: 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
130130
ALTER SYSTEM SET work_mem = 8192;
131-
NOTICE: in process utility: superuser attemptingalter system
131+
NOTICE: in process utility: superuser attemptingALTER SYSTEM
132132
NOTICE: in object_access_hook_str: superuser attempting alter (subId=0x2000, alter system) [work_mem]
133133
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
135135
ALTER SYSTEM RESET work_mem;
136-
NOTICE: in process utility: superuser attemptingalter system
136+
NOTICE: in process utility: superuser attemptingALTER SYSTEM
137137
NOTICE: in object_access_hook_str: superuser attempting alter (subId=0x2000, alter system) [work_mem]
138138
NOTICE: 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
141141
SET SESSION AUTHORIZATION regress_test_user;
142-
NOTICE: in process utility: superuser attemptingset
142+
NOTICE: in process utility: superuser attemptingSET
143143
NOTICE: in object_access_hook_str: non-superuser attempting alter (subId=0x1000, set) [session_authorization]
144144
NOTICE: 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
146146
SELECT * FROM regress_test_table;
147147
NOTICE: in object access: non-superuser attempting namespace search (subId=0x0) [no report on violation, allowed]
148148
LINE 1: SELECT * FROM regress_test_table;
@@ -165,83 +165,83 @@ NOTICE: in executor check perms: non-superuser finished execute
165165
(1 row)
166166

167167
SET work_mem = 8192;
168-
NOTICE: in process utility: non-superuser attemptingset
168+
NOTICE: in process utility: non-superuser attemptingSET
169169
NOTICE: in object_access_hook_str: non-superuser attempting alter (subId=0x1000, set) [work_mem]
170170
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 finishedSET
172172
RESET work_mem;
173-
NOTICE: in process utility: non-superuser attemptingset
173+
NOTICE: in process utility: non-superuser attemptingRESET
174174
NOTICE: in object_access_hook_str: non-superuser attempting alter (subId=0x1000, set) [work_mem]
175175
NOTICE: 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
177177
ALTER SYSTEM SET work_mem = 8192;
178-
NOTICE: in process utility: non-superuser attemptingalter system
178+
NOTICE: in process utility: non-superuser attemptingALTER SYSTEM
179179
ERROR: permission denied to set parameter "work_mem"
180180
ALTER SYSTEM RESET work_mem;
181-
NOTICE: in process utility: non-superuser attemptingalter system
181+
NOTICE: in process utility: non-superuser attemptingALTER SYSTEM
182182
ERROR: permission denied to set parameter "work_mem"
183183
SET test_oat_hooks.user_var1 = true;
184-
NOTICE: in process utility: non-superuser attemptingset
184+
NOTICE: in process utility: non-superuser attemptingSET
185185
NOTICE: in object_access_hook_str: non-superuser attempting alter (subId=0x1000, set) [test_oat_hooks.user_var1]
186186
NOTICE: 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
188188
SET test_oat_hooks.super_var1 = true;
189-
NOTICE: in process utility: non-superuser attemptingset
189+
NOTICE: in process utility: non-superuser attemptingSET
190190
ERROR: permission denied to set parameter "test_oat_hooks.super_var1"
191191
ALTER 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
193193
ERROR: permission denied to set parameter "test_oat_hooks.user_var1"
194194
ALTER 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
196196
ERROR: permission denied to set parameter "test_oat_hooks.super_var1"
197197
SET test_oat_hooks.user_var2 = true;
198-
NOTICE: in process utility: non-superuser attemptingset
198+
NOTICE: in process utility: non-superuser attemptingSET
199199
NOTICE: in object_access_hook_str: non-superuser attempting alter (subId=0x1000, set) [test_oat_hooks.user_var2]
200200
NOTICE: 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
202202
SET test_oat_hooks.super_var2 = true;
203-
NOTICE: in process utility: non-superuser attemptingset
203+
NOTICE: in process utility: non-superuser attemptingSET
204204
ERROR: permission denied to set parameter "test_oat_hooks.super_var2"
205205
ALTER 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
207207
ERROR: permission denied to set parameter "test_oat_hooks.user_var2"
208208
ALTER 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
210210
ERROR: permission denied to set parameter "test_oat_hooks.super_var2"
211211
RESET SESSION AUTHORIZATION;
212-
NOTICE: in process utility: non-superuser attemptingset
212+
NOTICE: in process utility: non-superuser attemptingRESET
213213
NOTICE: in object_access_hook_str: superuser attempting alter (subId=0x1000, set) [session_authorization]
214214
NOTICE: 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
217217
SET test_oat_hooks.deny_set_variable = true;
218-
NOTICE: in process utility: superuser attemptingset
218+
NOTICE: in process utility: superuser attemptingSET
219219
NOTICE: in object_access_hook_str: superuser attempting alter (subId=0x1000, set) [test_oat_hooks.deny_set_variable]
220220
NOTICE: 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
222222
SET test_oat_hooks.deny_alter_system = true;
223-
NOTICE: in process utility: superuser attemptingset
223+
NOTICE: in process utility: superuser attemptingSET
224224
NOTICE: in object_access_hook_str: superuser attempting alter (subId=0x1000, set) [test_oat_hooks.deny_alter_system]
225225
NOTICE: 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
227227
SET test_oat_hooks.deny_object_access = true;
228-
NOTICE: in process utility: superuser attemptingset
228+
NOTICE: in process utility: superuser attemptingSET
229229
NOTICE: in object_access_hook_str: superuser attempting alter (subId=0x1000, set) [test_oat_hooks.deny_object_access]
230230
NOTICE: 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
232232
SET test_oat_hooks.deny_exec_perms = true;
233-
NOTICE: in process utility: superuser attemptingset
233+
NOTICE: in process utility: superuser attemptingSET
234234
NOTICE: in object_access_hook_str: superuser attempting alter (subId=0x1000, set) [test_oat_hooks.deny_exec_perms]
235235
NOTICE: 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
237237
SET test_oat_hooks.deny_utility_commands = true;
238-
NOTICE: in process utility: superuser attemptingset
238+
NOTICE: in process utility: superuser attemptingSET
239239
NOTICE: in object_access_hook_str: superuser attempting alter (subId=0x1000, set) [test_oat_hooks.deny_utility_commands]
240240
NOTICE: 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
243243
SET SESSION AUTHORIZATION regress_test_user;
244-
NOTICE: in process utility: superuser attemptingset
244+
NOTICE: in process utility: superuser attemptingSET
245245
NOTICE: in object_access_hook_str: non-superuser attempting alter (subId=0x1000, set) [session_authorization]
246246
ERROR: permission denied: set session_authorization
247247
SELECT * FROM regress_test_table;
@@ -266,39 +266,39 @@ NOTICE: in executor check perms: superuser finished execute
266266
(1 row)
267267

268268
SET work_mem = 8192;
269-
NOTICE: in process utility: superuser attemptingset
269+
NOTICE: in process utility: superuser attemptingSET
270270
NOTICE: in object_access_hook_str: superuser attempting alter (subId=0x1000, set) [work_mem]
271271
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 finishedSET
273273
RESET work_mem;
274-
NOTICE: in process utility: superuser attemptingset
274+
NOTICE: in process utility: superuser attemptingRESET
275275
NOTICE: in object_access_hook_str: superuser attempting alter (subId=0x1000, set) [work_mem]
276276
NOTICE: 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
278278
ALTER SYSTEM SET work_mem = 8192;
279-
NOTICE: in process utility: superuser attemptingalter system
279+
NOTICE: in process utility: superuser attemptingALTER SYSTEM
280280
NOTICE: in object_access_hook_str: superuser attempting alter (subId=0x2000, alter system) [work_mem]
281281
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
283283
ALTER SYSTEM RESET work_mem;
284-
NOTICE: in process utility: superuser attemptingalter system
284+
NOTICE: in process utility: superuser attemptingALTER SYSTEM
285285
NOTICE: in object_access_hook_str: superuser attempting alter (subId=0x2000, alter system) [work_mem]
286286
NOTICE: 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
289289
RESET SESSION AUTHORIZATION;
290-
NOTICE: in process utility: superuser attemptingset
290+
NOTICE: in process utility: superuser attemptingRESET
291291
NOTICE: in object_access_hook_str: superuser attempting alter (subId=0x1000, set) [session_authorization]
292292
NOTICE: 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
294294
DROP INDEX CONCURRENTLY regress_test_table_t_idx;
295-
NOTICE: in process utility: superuser attemptingDropStmt
295+
NOTICE: in process utility: superuser attemptingDROP INDEX
296296
NOTICE: in object access: superuser attempting drop (subId=0x0) [concurrent drop,]
297297
NOTICE: 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
300300
SET test_oat_hooks.audit = false;
301-
NOTICE: in process utility: superuser attemptingset
301+
NOTICE: in process utility: superuser attemptingSET
302302
DROP ROLE regress_role_joe; -- fails
303303
ERROR: role "regress_role_joe" cannot be dropped because some objects depend on it
304304
DETAIL: privileges for parameter test_oat_hooks.user_var1

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp