This TRIGGER function calls PosgreSQL's NOTIFY
command with a JSON payload. You can listen for these calls and then send the JSON payload to a message queue (like AMQP/RabbitMQ) or trigger other actions.
Create the trigger with notify_trigger.sql.
When declaring the trigger, supply the column names you want the JSON payload to contain as arguments to the function (see create_triggers.sql)
The payload returns a JSON object: