Search⌘ K
AI Features

Transactional Event-Driven Processing

Explore how PostgreSQL triggers integrate with transactions to perform event-driven processing. Understand how triggers execute procedures upon data changes, manage rollback situations, and address concurrency issues through practical examples and test scripts.

We'll cover the following...

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 ...