My company has a very specific need to audit queries run against the DB, more specifically DML statements less selects. Ideally we want retrieve the specific metrics
- Who ran the query
- When was the query run
- What was the query
- Table(s) affected by the query (can probably be parsed out of the query itself)
- How many rows were affected by the query (consultants won't budge on this)
I've tried pg_stat_statments, the general log, the slow log, the binlog and pgaudit with no avail. Are there any solutions out there aside from table trigger that I can explore?
We would like to export the logs if possible for outside parsing, however this is not a hard requirement.