Skip to content

Google Cloud SQL for PostgreSQL

Constraints

  • Custom extensions cannot be installed. pg_auto_mv is deployed via SQL.
  • The postgres user has the cloudsql_superuser role, 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:

cloud-sql-proxy --port 5432 your-project:your-region:your-instance &

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):

psql -h 127.0.0.1 \
     -U postgres \
     -d your_database \
     -c "CREATE SCHEMA pgauto_mv;"

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

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

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.