PostgreSQL has a robust set of features which we can leverage to create a generic auditing solution in 150 lines of SQL.