Hacker News new | ask | show | jobs
by mamikonyana 3718 days ago
Couple of questions:

- If the trigger function hits a service that takes a long time to respond, how does that affect the system?

- Why did you have to reimplement trigger functions, what was the problem with using trigger functions for tables on continuous views?

1 comments

A) Continuous triggers are implemented by using the logical replication features of Postgres. This means that changes are consumed from a queue and evaluated in a separate process to the rest of the system. A long running trigger will block the trigger process only.

B) We do re-use quite a bit of the standard trigger mechanisms, but we wanted to use our own evaluation context to support extra features. For example, continuous triggers can be defined on sliding windows, which require the trigger to be evaluated over multiple transformed tuples in the underlying table.