# recovery_target_timeline

> recovery_target_timeline specifies the timeline to recover into. It is a postmaster setting present in PG12–18; the latest recorded boot default is latest.
---

> [!NOTE]
> **Fact — official short description:** “Specifies the timeline to recover into.”

## Identity {#identity}

| Field | Value | Meaning |
| --- | --- | --- |
| Type | `string` | Upstream pg_settings type |
| Context | `postmaster` | Requires a server restart |
| Unit | — | Raw unit |
| Range | — | Raw limits in the last observed version |
| Enum values | — | — for non-enum types |
| Category | Write-Ahead Log / Recovery Target | Upstream classification |
| Latest boot value | `latest` | latest |
{.fields meta="-"}

## Lifecycle {#lifecycle}

| Fact | Value |
| --- | --- |
| First observed | PG12 |
| Present in | PG12–19 Beta 3 |
| Removed in | No |
| Introduction commit | [`2dedf4d9a899`](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=2dedf4d9a899b36d1a8ed29be5efbd1b31a8fe85) — Integrate recovery.conf into postgresql.conf |
| Commit date | 2018-11-25 |
| Discussion | [thread 1](https://www.postgresql.org/message-id/flat/607741529606767@web3g.yandex.ru/) |

## Default history {#default-history}

| Versions | Raw `boot_val` | Unit | Human value |
| --- | --- | --- | --- |
| PG12–19 Beta 3 | `latest` | — | latest |
{.full-width caption="Measured PG9.0–19 Beta 3 boot defaults"}

## How it works {#mechanism}

Specifies the timeline history that recovery follows. The value is read at server start for the recovery run.

latest follows the newest timeline found in the archive, current stays on the timeline current when the base backup was taken, and an explicit decimal or 0x-prefixed hexadecimal ID selects a particular branch. A timeline can be selected with or without an earlier stopping target.

The chosen timeline must descend from the base backup and its history/WAL files must be available. This setting selects a branch; it does not itself choose a transaction boundary or promote the server.

## Tuning advice {#tuning-advice}

> [!TIP]
> **Advice.** These are workload-specific starting points and must be validated with measurements.

| Workload | Guidance |
| --- | --- |
| OLTP | This is not a steady-state performance knob. Set recovery_target_timeline only on an isolated recovery instance after recording target evidence, base backup, timeline, and expected boundary; rehearse and require a second-person review. |
| OLAP | For a large restore, budget WAL replay and inspection time first. Validate the reached point read-only; do not let heavy analytical queries delay or contaminate the recovery decision. |
| Small nodes | Prefer a backup tool that generates a controlled recovery configuration. Never leave target settings in ordinary primary/standby templates, and clean up signal files and targets afterward. |
{.full-width}

## Pigsty {#pigsty}

Values use the fixed 8-vCPU, 32-GiB, 100-GiB SSD fixture and render the current Pigsty templates for PG19 Beta 3; this does not assert current Pigsty support for that historical or beta release.

| Template | Effective value | Versus upstream boot | Source expression |
| --- | --- | --- | --- |
| OLTP | Unmodified | — | — |
| OLAP | Unmodified | — | — |
| CRIT | Unmodified | — | — |
| TINY | Unmodified | — | — |
{.full-width}

> [!CAUTION]
> **Advice — pending human review.** Fact from the current Pigsty template projection: OLTP: PG12–19 Beta 3 unmodified; OLAP: PG12–19 Beta 3 unmodified; CRIT: PG12–19 Beta 3 unmodified; TINY: PG12–19 Beta 3 unmodified. No Pigsty-specific rationale is inferred from an absent override.

## Common pitfalls {#common-pitfalls}

- Using latest when a deliberate re-recovery must stay on an older branch.
- Using current when the required WAL exists only on a descendant timeline.
- Selecting a timeline not descended from the base backup.
- Failing to retain the timeline history file and corresponding WAL.
- Treating timeline selection as a stopping target or promotion command.

## Related parameters {#related-parameters}

[`recovery_target`](/parameters/recovery-target/) · [`recovery_target_time`](/parameters/recovery-target-time/) · [`recovery_target_lsn`](/parameters/recovery-target-lsn/) · [`recovery_target_action`](/parameters/recovery-target-action/) · [`restore_command`](/parameters/restore-command/) · [`primary_conninfo`](/parameters/primary-conninfo/)

## References {#references}

- [PostgreSQL 19 Beta 3 — recovery_target_timeline](https://www.postgresql.org/docs/19/runtime-config-wal.html#GUC-RECOVERY-TARGET-TIMELINE)
- [PostgreSQL 19 release notes](https://www.postgresql.org/docs/19/release-19.html)
- [Machine-readable GUC export](/data/guc.jsonl)
