I want to only log queries that modify tables (INSERT, DELETE, UPDATE) while ignoring all SELECTs and its equivalents.
However, in the documentation, my options are to log ddl, ddl+mod or all in the log_statement line of the postgresql.conf file.
Is there some way to log into files all queries that manipulate data by changing settings of the configuration file or will I have to use some outside script or log to tables?
My current settings on my postgresql.conf, which still logs SELECT queries, are as follow:
log_destination = 'syslog, csvlog'
logging_collector = on
log_min_duration_statement = 0
log_statement = mod
As a_horse_with_no_name and Craig pointed out, log_statement = mod shouldn't be logging select statements.
My problem was log_min_duration_statement = 0, which was acting as an AND, so to say (log this AND that). I've commented the log_min_duration out and now it is only logging what I actually needed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With