Collecting data changes from the server log

The following is the easiest way to do auditing, and requires the least amount of setup:

  • Set log_statement to mod or all in the server log
  • Collect all INSERT, UPDATE, DELETE, and TRUNCATE commands from the log

Alternatively, you can do one of the following: just set up a way to store the logs on the database server, copy them to another host, or collect them with a version of syslog that allows you to collect logs on a designated logging server from the start.

Get PostgreSQL Administration Cookbook, 9.5/9.6 Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.