Skip to content
Advertisement

How can I use a PostgreSQL triggers to store changes (SQL statements and row changes)

Using PostgreSQL triggers, is it possible to record the changes that have happened to a table due to INSERT or UPDATE SQL statements and log them to a file for later execution.

This is only to be used temporally so just something quick and dirty would do.

Advertisement

Answer

example of an audit trigger from https://www.postgresql.org/docs/current/static/plpgsql-trigger.html

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement