Before you start¶
You need:
-
PostgreSQL 15 or later — check with your DBA.
-
pg_relay v1.1.2+ running, including the
pgrelay.scheduletype — pg_relay is the background process that executes refresh jobs. If it is not running, events will queue up and be processed when it starts. pg_auto_mv also uses pg_relay's sharedpgrelay.schedulerecurrence type, which your DBA installs as a separate step (it is not part of the pg_relay extension). Ask your DBA to confirm both. See DBA_GUIDE.md — Installation. (On a multi-node cluster, refresh jobs always run on the node where they were created — this is automatic and needs nothing from you; the DBA-side details are in DBA_GUIDE.md.) -
Permission to call pg_auto_mv functions — This assumes you have already installed pg_auto_mv, otherwise disregard this point. After installation, only the role that installed the extension can use the public functions. Ask your DBA to grant access to your role. See DBA_GUIDE.md — Security.
-
The materialised view must already exist — create it with
CREATE MATERIALIZED VIEWbefore callingregister_mv(). pg_auto_mv will not create it for you. -
A unique index on the view — required for the default concurrent refresh mode. If you do not have one, create it before registering. (If you cannot add a unique index, pass
p_concurrent => falsewhen registering — but this blocks readers during a refresh, so it is not recommended for production.) Pg_auto_mv can refresh views without using CONCURRENT, it is just recommended to do so.