I have a materialized view on a PostgreSQL 9.3 database which seldom changes (about twice a day). But when it does, I\'d like to update its data promptly.
Here is wha
PostgreSQL 9.4 added REFRESH CONCURRENTLY
to Materialized Views.
This may be what you're looking for when you describe trying to setup an asynchronous update of the materialized view.
Users selecting from the materialized view will see incorrect data until the refresh finishes, but in many scenarios that use a materialized view, this is an acceptable tradeoff.
Use a statement level trigger that watches the underlying tables for any changes and then refreshes the materialized view concurrently.