What's the closest we can get to `REFRESH COMPLETE ON COMMIT` in PostgresQL?
问题 So we're looking for a way to enforce constraints that span multiple tables. We've come across this old blog post, which suggests: Create a materialized view to select data that violates the desired constraint. The MV must be defined with REFRESH COMPLETE ON COMMIT so that it is updated before the end of the transaction. Create a check constraint on the materialized view that always evaluates to FALSE – e.g. CHECK (1=0) That’s it. Whenever the underlying tables are updated, the materialized