Four Hidden Pitfalls of Postgres Logical Replication for Reporting Replicas
A software developer has documented four critical but rarely discussed problems encountered when setting up a PostgreSQL logical replication-based reporting replica. Unlike physical replication, logical replication decodes WAL changes into row-level operations, allowing selective table replication, cross-version compatibility, and replica-only indexes — but with notable trade-offs. One major issue is that DDL changes like adding columns are not replicated, meaning schema migrations must be manually coordinated on both the primary and subscriber databases to avoid silent data gaps or replication errors. Another overlooked problem involves sequences for SERIAL and IDENTITY columns, which are not replicated at all, leaving the replica's sequence counters out of sync and risking duplicate key errors if the replica is ever written to or promoted. The article urges teams to treat replicated-table migrations as two-database operations and plan for sequence management upfront rather than discovering these gaps during incidents.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in