Trigger trigger launch in postgres 9.1

We have a database that has a huge amount of business logic stored in triggers inside the database. Is there a way to register trigger triggers along with arguments that were fired and what they changed?

I saw a lot of tutorials on how to conduct a table audit with triggers, but I would like to test triggers, not tables :)

+4
source share
1 answer

Take one of the examples that validates a table using triggers. Use their approach to retrieve the changed data, but do not write the data to the audit table, but use it for RAISE NOTICE .

This notification will be written to the PostgreSQL log file if you configured the logging configuration correctly ( log_min_messages = notice )

For more information about RAISE, see the manual: http://www.postgresql.org/docs/current/static/plpgsql-errors-and-messages.html

+3
source

Source: https://habr.com/ru/post/1403835/


All Articles