@@ -87,10 +87,8 @@ NOTICE: Skipping event trigger function "show_current_user" for user "postgres"
87
87
DETAIL: "postgres" is a superuser and the function "show_current_user" is not superuser-owned, it's owned by "privileged_role"
88
88
\echo
89
89
90
- -- extensions won't execute the event trigger function (since they're executed by superuser under our implementation)
91
- set role rolecreator;
92
- \echo
93
-
90
+ -- creating extensions will not fire evtrigs
91
+ set role privileged_role;
94
92
create extension postgres_fdw;
95
93
NOTICE: Skipping event trigger function "show_current_user" for user "postgres"
96
94
DETAIL: "postgres" is a superuser and the function "show_current_user" is not superuser-owned, it's owned by "privileged_role"
@@ -99,6 +97,24 @@ NOTICE: Skipping event trigger function "show_current_user" for user "postgres"
99
97
DETAIL: "postgres" is a superuser and the function "show_current_user" is not superuser-owned, it's owned by "privileged_role"
100
98
\echo
101
99
100
+ -- creating fdws will not fire evtrigs
101
+ create foreign data wrapper new_fdw;
102
+ NOTICE: Skipping event trigger function "show_current_user" for user "postgres"
103
+ DETAIL: "postgres" is a superuser and the function "show_current_user" is not superuser-owned, it's owned by "privileged_role"
104
+ -- TODO: while correct, this is inconsistent as dropping the fdw does fire the evtrig for the privileged_role
105
+ drop foreign data wrapper new_fdw;
106
+ NOTICE: the event trigger is executed for privileged_role
107
+ \echo
108
+
109
+ -- creating pubs will not fire evtrigs
110
+ create publication p for all tables;
111
+ NOTICE: Skipping event trigger function "show_current_user" for user "postgres"
112
+ DETAIL: "postgres" is a superuser and the function "show_current_user" is not superuser-owned, it's owned by "privileged_role"
113
+ -- TODO: while correct, this is inconsistent as dropping the publication does fire the evtrig for the privileged_role
114
+ drop publication p;
115
+ NOTICE: the event trigger is executed for privileged_role
116
+ \echo
117
+
102
118
-- privesc shouldn't happen due to superuser tripping over a user-defined event trigger
103
119
set role privileged_role;
104
120
\echo
0 commit comments