PostgreSQL timeline
A PostgreSQL timeline identifies a branch of a database cluster's write-ahead-log history.
Completing archive recovery creates a new branch for subsequent WAL, preserving the earlier history. Timeline IDs distinguish WAL filenames. [1]
Selection: recovery_target_timeline accepts an ID, current for the base backup's timeline, or latest, the default. This selects history, not the replay stopping point. [2]
Interpretation: a larger timeline ID alone does not establish ancestry or possession of another branch's commits. Compare cluster identity, timeline history and the named LSN progress stage together. IDENTIFY_SYSTEM reports systemid, timeline and the current WAL flush position separately. [3] [4]
Backup scope: a standby following an upstream promotion during a base backup can require WAL ranges on several timelines. The manifest retains the timeline for each range rather than one unqualified byte interval. [6]
Relations
- related
- Timeline history file (PostgreSQL), Log sequence number, Replication lag, Point-in-time recovery, Recovery target, Backup manifest
Citations
- PostgreSQL 18: Timelines
- PostgreSQL 18: recovery_target_timeline
- PostgreSQL 18: IDENTIFY_SYSTEM and TIMELINE_HISTORY
- PostgreSQL 18.0: timeline history reader and writer
- PostgreSQL 18: Backup Manifest WAL Range Object