Timeline history file (PostgreSQL)
A PostgreSQL timeline history file records ancestor timelines and WAL switchpoints used to select the appropriate log history during recovery.
The child timeline's .history file inherits its parent's history and adds the parent ID, switchpoint LSN and reason. PostgreSQL 18.0 writes parent IDs in decimal within entries; the filename encodes the child ID in hexadecimal. Timeline 1 has no preceding branch and normally has no history file. [1]
The replication command TIMELINE_HISTORY retrieves a specified timeline's filename and contents. This metadata identifies history, not the availability or integrity of all required WAL segments. [2]
Keep this ancestry metadata distinct from a backup manifest's required WAL intervals. A history file helps select the branch; it is not an inventory proving that its segments are retrievable. [1]
Relations
- related
- PostgreSQL timeline, WAL archiving, Point-in-time recovery, Log sequence number, Backup manifest
Citations
- PostgreSQL 18.0: timeline history reader and writer
- PostgreSQL 18: IDENTIFY_SYSTEM and TIMELINE_HISTORY