1

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

  1. Who ran the query
  2. When was the query run
  3. What was the query
  4. Table(s) affected by the query (can probably be parsed out of the query itself)
  5. 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.

AJY
  • 188
  • 2
  • 12

0 Answers0