Skip to content

Dependencies

pg_relay must be installed before CREATE EXTENSION pg_auto_mv. The final two statements of the extension SQL file insert rows into pgrelay.actions:

Channel Action
pg_auto_mv.refresh_materialised_view SELECT pgauto_mv._process_pending($1::uuid)
pg_auto_mv.sync_mv CALL pgauto_mv.sync_mv(p_auto_mv_id => NULLIF($1, '')::uuid)

Both use ON CONFLICT (channel) DO NOTHING. If pg_relay is not installed the INSERT fails and the extension install fails — this is the intended dependency enforcement mechanism (the control file also declares requires = 'pg_relay').

pg_auto_mv 1.1 requires pg_relay >= 1.1.0 (enforced by a version gate in the upgrade script against pgrelay.pg_relay_applications). Both channels are registered with node_restricted = true — a pg_relay 1.1 feature that pins every queue row to the node that created it. A materialised view refresh has node-local side effects (each node holds its own physical matview heap), so under pg_relay's multi-master modes the rows must never be dispatched by, deduplicated against, or adopted onto another node. With the flag set, pg_relay guarantees all three — pg_auto_mv's own dispatch logic is unchanged from 1.0.

Channel names use the extension name (pg_auto_mv.) not the schema name (pgauto_mv.). The schema is named pgauto_mv because PostgreSQL 16+ blocks pg_-prefixed schema creation.