Skip to content

Azure Database for PostgreSQL Flexible Server

Constraints

  • Custom extensions cannot be installed. pg_auto_mv is deployed via SQL.
  • The admin user (configured at server creation) has sufficient privileges for all pg_auto_mv setup steps.
  • SSL is enforced by default. If you followed the pg_relay cloud guide, PGSSLMODE=require is already set.
  • Firewall rules are already in place from the pg_relay setup — no additional rules are needed for pg_auto_mv installation (you are using the same connection).

Step 1 — Create the pgauto_mv Schema

export PGSSLMODE=require

psql -h your-server.postgres.database.azure.com \
     -U adminuser \
     -d your_database \
     -c "CREATE SCHEMA pgauto_mv;"

Step 2 — Deploy the pg_auto_mv Objects

psql -h your-server.postgres.database.azure.com \
     -U adminuser \
     -d your_database \
     -f sql/pg_auto_mv--1.0.sql \
     -f sql/pg_auto_mv--1.0--1.1.sql

Step 3 — Verify the Installation

SELECT channel, action
FROM pgrelay.actions
WHERE channel LIKE 'pg_auto_mv.%'
ORDER BY channel;

High Availability

Azure Flexible Server HA automatically updates the server FQDN during failover. The pg_relay Processor reconnects to the new primary transparently. pg_auto_mv state is preserved by Azure's standard HA replication.