logical-decoding · shipping · also PostgreSQL logical decoding

Logical decoding

Logical decoding reconstructs database changes from a storage-level log into a representation that a consumer can interpret without the database's physical storage format.

Related Observatory article: Read on hesela.com

PostgreSQL uses output plugins to translate WAL into change streams. A logical slot serves one database and has its own progress state. [1] A disconnected slot can retain system-catalog row versions needed for decoding, so monitoring only retained WAL misses part of its resource footprint. [1]

For PostgreSQL 16 built-in logical replication, serial/identity column values travel with table rows but their sequence state does not. A writable-subscriber switchover therefore needs a separate allocator check. This restriction is not a statement about physical WAL replication, and pg_dump --data-only has a different documented scope that includes sequence values. [3] [4]

Relations

related
Replication slot, Write-ahead log, Log sequence number, Idempotency, Logical failover slot, Hot standby feedback, PostgreSQL sequence

Limitations

  • After a crash, checkpointed slot progress can rewind and recent changes can be delivered again; consumers must prevent duplicate effects. [1]

Citations

  1. PostgreSQL 18: logical decoding concepts and crash replay (accessed 2026-10-16)
  2. PostgreSQL 16: logical replication restrictions, sequence state (accessed 2026-10-28)
  3. PostgreSQL 16: pg_dump, data-only scope includes sequence values (accessed 2026-10-28)

Further reading

  1. Hesela: Replication acknowledgements, retention and decoding (accessed 2026-10-16)

JSON: /data/terms/logical-decoding.json

Published by Hesela team · Updated

Report a correction · Editorial standards · Reuse guidance

Cite this page
Hesela team. Logical decoding. Hesela. 2026-10-28. https://hesela.dev/terms/logical-decoding/