AWS Aurora for PostgreSQL¶
Aurora for PostgreSQL is PostgreSQL-compatible. The setup is identical to RDS with one critical difference: you must connect to the writer endpoint, not a reader endpoint or an instance endpoint.
Constraints¶
All RDS constraints apply, plus:
Connect to the cluster writer endpoint. Aurora readers are read-only replicas. pg_auto_mv writes to pgauto_mv.mv_state, pgauto_mv.mv_events, and pgauto_mv.mv_refresh_log during normal operation. All DML must target the writer.
Your cluster endpoints:
| Endpoint type | Format | Use |
|---|---|---|
| Writer (use this) | my-cluster.cluster-abc123.us-east-1.rds.amazonaws.com |
All pg_auto_mv installation and operation |
| Reader (do not use) | my-cluster.cluster-ro-abc123.us-east-1.rds.amazonaws.com |
Application reads only |
Step 1 — Create the pgauto_mv Schema¶
psql -h my-cluster.cluster-abc123.us-east-1.rds.amazonaws.com \
-U postgres \
-d your_database \
-c "CREATE SCHEMA pgauto_mv;"
Step 2 — Deploy the pg_auto_mv Objects¶
psql -h my-cluster.cluster-abc123.us-east-1.rds.amazonaws.com \
-U postgres \
-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¶
Failover Behaviour¶
During an Aurora failover, the pg_relay Processor disconnects and reconnects to the new primary via the writer endpoint. Any pg_auto_mv events that were enqueued in pgrelay.queue before the failover will be processed when the Processor reconnects — no events are lost. The materialised view state (pgauto_mv.mv_state) is preserved across failover by Aurora's standard replication.