Skip to content

Before you start

You need:

  1. PostgreSQL 15 or later — check with your DBA.

  2. pg_relay v1.1.2+ running, including the pgrelay.schedule type — 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 shared pgrelay.schedule recurrence 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.)

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

  4. The materialised view must already exist — create it with CREATE MATERIALIZED VIEW before calling register_mv(). pg_auto_mv will not create it for you.

  5. 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 => false when 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.