A practical step-by-step guide to setting up PostgreSQL logical replication for zero-downtime major version upgrades in production. Covers the full workflow: checking and setting replica identity for tables without primary keys, exporting globals and schema, creating publications and subscriptions, monitoring replication lag, and handling known gaps like DDL not being replicated and sequences needing manual advancement before cutover. Includes ready-to-run SQL queries for each step and production-specific tips like disabling statement_timeout for the replication user.

8m read timeFrom postgr.es
Post cover image
Table of contents
Why Logical ReplicationWhat logical replication doesn’t handle
217 Impressions