Seamless Major Version Upgrades: Bringing DDL Replication to PostgreSQL

Friday, October 02 · 11:00–11:50
Type Intermediate

Logical replication has become a go-to strategy for minimizing downtime during PostgreSQL major version upgrades. But there is one critical gap: DDL changes are not replicated. During the upgrade window, every schema change on the publisher must be manually tracked and re-applied on the subscriber — a tedious and error-prone process that becomes the single biggest operational burden in large-scale upgrades. This talk explores why that gap exists and what it takes to close it. We will first examine the real challenges of keeping schemas in sync during online upgrades. Then we will dive into a subtle but critical problem: you cannot simply replay the original DDL on the subscriber. Differences in search_path, implicit type resolution, and operator lookup mean that an unqualified DDL statement may silently act on the wrong object. This is the query qualification problem, and understanding it is valuable for anyone working with multi-schema environments today. From there, we will discuss what it would take to build DDL replication into PostgreSQL core — the design space, the open questions, and the trade-offs between different approaches. We will also look ahead: what would major version upgrades look like in a world where DDL replication just works?