{
  "slug": "recovery-target",
  "term": "Recovery target",
  "aliases": [
    "PITR stopping point"
  ],
  "definition": "A recovery target is the configured condition at which database log replay should stop.",
  "note": "PostgreSQL 18 accepts one target type: time, transaction ID, LSN, named restore point or the earliest consistent state. The inclusive setting governs time, transaction-ID and LSN boundaries; timeline selection identifies the history branch. [pg-target]\n\nAction: for a configured target, recovery_target_action chooses whether to finish recovery (promote), stop the server (shutdown), or pause for inspection (pause, the default). With hot_standby off, pause acts as shutdown; during ongoing promotion it acts as promote. At a target pause, pg_wal_replay_resume() ends recovery. A later target requires stopping the server, changing the target and restarting. The shutdown action retains recovery.signal, so an unchanged restart stops again. The action has no effect without a configured target. [pg-target]\n\nInspection: pg_is_wal_replay_paused() reports a request, not necessarily a completed pause. pg_get_wal_replay_pause_state() distinguishes not paused, pause requested and paused; the last means replay is actually paused. [pg-control]",
  "advantages": [
    {
      "text": "An explicit target makes the intended replay endpoint inspectable.",
      "citationIds": [
        "pg-target"
      ]
    }
  ],
  "limitations": [
    {
      "text": "PostgreSQL raises a fatal error if archive recovery ends before a configured target is reached.",
      "citationIds": [
        "pg-target"
      ]
    },
    {
      "text": "A target is a recovery setting, not the recovery point objective that specifies acceptable data loss.",
      "citationIds": [
        "pg-target",
        "nist-recovery"
      ]
    }
  ],
  "related": [
    "point-in-time-recovery",
    "wal-archiving",
    "restore-test",
    "recovery-point-objective",
    "postgresql-timeline",
    "full-backup"
  ],
  "citations": [
    {
      "id": "pg-target",
      "title": "PostgreSQL 18: Recovery Target",
      "url": "https://www.postgresql.org/docs/18/runtime-config-wal.html#RUNTIME-CONFIG-WAL-RECOVERY-TARGET",
      "accessed": "2026-11-02"
    },
    {
      "id": "nist-recovery",
      "title": "NIST SP 800-34 Rev. 1: Recovery objectives",
      "url": "https://nvlpubs.nist.gov/nistpubs/legacy/sp/nistspecialpublication800-34r1.pdf",
      "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-control",
      "title": "PostgreSQL 18: Recovery Control Functions, requested and actual pause states",
      "url": "https://www.postgresql.org/docs/18/functions-admin.html#FUNCTIONS-RECOVERY-CONTROL",
      "accessed": "2026-11-02"
    }
  ],
  "status": "shipping",
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-11-02"
}
