{
  "slug": "logical-decoding",
  "term": "Logical decoding",
  "aliases": [
    "PostgreSQL logical decoding"
  ],
  "definition": "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.",
  "note": "PostgreSQL uses output plugins to translate WAL into change streams. A logical slot serves one database and has its own progress state. [pg-decoding] A disconnected slot can retain system-catalog row versions needed for decoding, so monitoring only retained WAL misses part of its resource footprint. [pg-decoding]",
  "status": "shipping",
  "advantages": [],
  "limitations": [
    {
      "text": "After a crash, checkpointed slot progress can rewind and recent changes can be delivered again; consumers must prevent duplicate effects.",
      "citationIds": [
        "pg-decoding"
      ]
    }
  ],
  "related": [
    "replication-slot",
    "write-ahead-log",
    "log-sequence-number",
    "idempotency",
    "failover-slot",
    "hot-standby-feedback"
  ],
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-10-16",
  "citations": [
    {
      "id": "pg-decoding",
      "title": "PostgreSQL 18: logical decoding concepts and crash replay",
      "url": "https://www.postgresql.org/docs/18/logicaldecoding-explanation.html",
      "accessed": "2026-10-16"
    },
    {
      "id": "hesela-replication",
      "title": "Hesela: Replication acknowledgements, retention and decoding",
      "url": "https://hesela.com/analyses/replication-acknowledgements-durability-lag/",
      "accessed": "2026-10-16"
    }
  ]
}
