1

Does PostgreSQL record under which user a settings change was carried out?

For example, view if user "postgres" changed the wal_level, or "userA".

If so, how/where can the log be seen?

1
  • 1
    Maybe if you log statement = all - but this has serious performance implications. And what the server cannot do is audit an edit made to the postgresql.conf file and a restart!
    – Vérace
    Aug 21 at 20:19

1 Answer 1

2
+25

Changing wal_level is something that requires a server restart. It can be done in three ways:

  1. edit postgresql.conf and restart the server

  2. change the setting with ALTER SYSTEM and restart the server

  3. stop the server and restart it with -c wal_level=whatever

The first and the third options don't involve an SQL statement or a database user, so they won't leave a trace in the database. You can record calls to ALTER SYSTEM by setting log_statement = 'ddl'.

So in general, there is no way to find out when and by whom wal_level was changed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.