{
  "slug": "wal-archiving",
  "term": "WAL archiving",
  "aliases": [
    "continuous WAL archiving"
  ],
  "definition": "WAL archiving preserves write-ahead-log segments for later recovery before normal log recycling can remove them.",
  "note": "PostgreSQL 18 archives completed segments; low activity can delay archival. Local commit durability therefore does not by itself prove archive coverage. [pg-archive]",
  "advantages": [],
  "limitations": [
    {
      "text": "A successful archive command must mean the file is safely preserved, not merely that copying was attempted.",
      "citationIds": [
        "pg-archive"
      ]
    },
    {
      "text": "archive_timeout schedules segment switches, not completed transfers; treating it alone as an end-to-end RPO bound is unjustified. This is Hesela's inference from the documented mechanism.",
      "citationIds": [
        "pg-timeout"
      ]
    },
    {
      "text": "last_archived_wal does not prove all earlier segments were archived: ordering is not guaranteed. Some failures that restart the archiver are not counted in pg_stat_archiver.",
      "citationIds": [
        "pg-stats",
        "pg-archive"
      ]
    }
  ],
  "related": [
    "point-in-time-recovery",
    "recovery-target",
    "write-ahead-log",
    "backup-verification"
  ],
  "citations": [
    {
      "id": "pg-archive",
      "title": "PostgreSQL 18: Continuous Archiving and Point-in-Time Recovery",
      "url": "https://www.postgresql.org/docs/18/continuous-archiving.html",
      "accessed": "2026-10-14"
    },
    {
      "id": "hesela-backup-evidence",
      "title": "Hesela: Backup verification is not a restore test",
      "url": "https://hesela.com/analyses/backup-verification-is-not-a-restore-test/",
      "accessed": "2026-10-14"
    },
    {
      "id": "pg-timeout",
      "title": "PostgreSQL 18: archive_timeout",
      "url": "https://www.postgresql.org/docs/18/runtime-config-wal.html#GUC-ARCHIVE-TIMEOUT",
      "accessed": "2026-10-14"
    },
    {
      "id": "pg-stats",
      "title": "PostgreSQL 18: pg_stat_archiver",
      "url": "https://www.postgresql.org/docs/18/monitoring-stats.html#PG-STAT-ARCHIVER-VIEW",
      "accessed": "2026-10-14"
    }
  ],
  "status": "shipping",
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-10-14"
}
