Transactional Event-Driven Processing

Learn about the test script of the trigger and its output.

PostgreSQL triggers call a registered procedure each time one of the supported events is committed. The execution of the procedure is always taken as a part of the transaction, so if our procedure fails at runtime, then the transaction is aborted.

Trigger test script

A classic example of event-driven processing with a trigger in our context is to update the counters of rts and favs each time there’s a related insert in the tweet.activity table.

Get hands-on with 1200+ tech skills courses.