Google Cloud SQL for PostgreSQL¶
Constraints¶
- Custom extensions cannot be installed. pg_auto_mv is deployed via SQL.
- The
postgresuser has thecloudsql_superuserrole, not true superuser. It has sufficient privileges for all pg_auto_mv setup steps. - If you deployed pg_relay using the Cloud SQL Auth Proxy (recommended), use the same proxy connection for these steps.
Step 1 — Ensure the Auth Proxy is Running¶
If the proxy is not already running from the pg_relay setup, start it:
See the pg_relay Cloud Setup Guide for full Auth Proxy installation and configuration instructions.
Step 2 — Create the pgauto_mv Schema¶
Connect via the proxy (localhost):
Step 3 — Deploy the pg_auto_mv Objects¶
psql -h 127.0.0.1 \
-U postgres \
-d your_database \
-f sql/pg_auto_mv--1.0.sql \
-f sql/pg_auto_mv--1.0--1.1.sql
Step 4 — Verify the Installation¶
Direct IP (without Auth Proxy)¶
If your Cloud SQL instance has a public IP and you are not using the proxy, use the public IP directly with PGSSLMODE=require. See the pg_relay Cloud Setup Guide for instructions on authorised networks and direct IP configuration.
High Availability¶
Cloud SQL HA routes the proxy connection name and public IP to the current primary. Failover is transparent to the pg_relay Processor. Queued pg_auto_mv events are processed after the Processor reconnects.