Nikolay Samokhvalov <samokhvalov@xxxxxxxxx> writes: > On Sun, Dec 19, 2021 at 10:43 PM Holger Jakobs <holger@xxxxxxxxxx> wrote: >> There is a setting log_statements which can be set to none (the default), >> ddl, mod or all > ..and, unfortunately, any user will be able to set it back via SET. Really? regression=# create user joe; CREATE ROLE regression=# \c - joe You are now connected to database "regression" as user "joe". regression=> set log_statement = none; ERROR: permission denied to set parameter "log_statement" It is true that superusers can change that variable. However, if you are trying to force monitoring of an uncooperative superuser, you are in for a hard slog. regards, tom lane