May 2019
Intermediate to advanced
600 pages
20h 46m
English
Both log_statement and pgaudit output audit log records to the server log. This is the most flexible approach since the log can be routed in various ways to ensure it is safe and separate from normal log entries.
If you allow the log entries to go the normal server log, you can find all occurrences of the CREATE, ALTER, and DROP commands in the log:
postgres@hvost:~$ egrep -i “create|alter|drop” \/var/log/postgresql/postgresql-11-main.log
If log rotation is in effect, you may need to use grep on older logs as well.
If the available logs are too new and you haven't saved the older logs in some other place, you are out of luck.
The default settings in the postgresql.conf file for log rotation are as follows:
log_filename ...
Read now
Unlock full access