concept Data & storage
Backup retention and restore dependencies
An old base can supply blocks a newer recovery point still needs through an intermediate backup. Keep the whole dependency chain, even when the base predates the retention window.
What it means
Keeping a recovery point means keeping the backups it needs, the backups they need, and so on—even when one is older than the recovery window. The cutoff selects the points you want to recover to; it does not tell you how far back their dependencies reach.
In PostgreSQL 18, earlier backups supply blocks omitted from an incremental backup. If a block needed for a retained point comes from an old base, losing that base leaves a gap even though the newer backup is still present.
Try it
Use synthetic backup IDs only. This local simulation compares a proposal with a supplied graph; it does not inspect or change a repository.
Backup retention and restore dependencies
Apply a declared retention policy to a synthetic dependency graph; distinguish requested expirations from sets still needed for retained recovery points.
Local simulation only: no device, service, stored object or database is changed, and no real operation is authorized.
Retained recovery points retain every transitive prerequisite. A proposed item outside this closure is only not required by this supplied graph.
Retained recovery points retain their prerequisites
- Transitive prerequisite closure
- F0 · I1 · I2
- Proposed expirations still needed
- F0
- Not needed by this graph only
- None
- Actual deletion authorized
- No
Follow retained point → prerequisite
- I2
- I2 → I1
- I2 → I1 → F0
Evaluated evidence
- Backup dependency graph
- F0: None; I1: F0; I2: I1; F3: None; I4: F3
- Retained recovery points
- I2
- Proposed expirations
- F0
Plan only, not deletion advice or a restore test. Real inventory, other retention policies, WAL dependencies, access and backup validity may add prerequisites.
About this model
Every input is local synthetic evidence. Numbers stay as raw text until this model validates them. The shown evaluated values come from the same result as the explanation.
Presets replace the entire scenario. Reset restores all starting fields, scenario selection and model state; it does not change the open or closed state of this help or article FAQ.
No external request, device command, stored-input history or measurement is performed.
- Backup dependency graph:
{"F0":[],"I1":["F0"],"I2":["I1"],"F3":[],"I4":["F3"]}. Each list names the backups the named point needs directly;[]means no prerequisites are declared for that point. - Retained recovery points:
I2. - Proposed expirations:
F0.
Start with I2 itself. It needs I1, which in turn needs F0. Following I2 → I1 → F0 gives the Transitive prerequisite closure: F0, I1, I2. The proposal names F0, so F0 is blocked under Proposed expirations still needed. The separate base F3 is not required by I2. To see the distinction, change only the proposal to F0 F3: F0 stays blocked, while F3 falls under Not needed by this graph only.
Now choose Retain the other backup chain. The proposal is again F0, but the retained point is I4. Its path is I4 → F3, so the required set is F3, I4. What changed was the point you chose to keep, not the age of F0. Although F0 is outside this closure, Actual deletion authorized is still false.
With Inspect the evidence boundary, I2 names MISSING as a prerequisite, but the graph has no entry for it. The proposed F0 is absent too. The result is unknown: a missing entry is not the same as an entry with []. By contrast, a cycle such as I2 → I1 → F0 → I2 is invalid, as is malformed graph JSON. Stop in either case: resolve missing inventory or correct invalid input before interpreting the proposal. Reset returns all inputs and the simulation state to their starting values.
In practice
Start from all the points you intend to keep and follow their prerequisites in the repository inventory. Account for the repository’s other retention rules too. For example, pgBackRest’s retention options account for backups that depend on a full backup set; the simulation does not reproduce a particular pgBackRest policy. The linked documentation is rolling; check the policy for the version you actually use before applying any retention decision.
A complete path in the graph is not a restore test. It does not establish that the backup data is intact, that you can read it, or that the recovery environment works. For PostgreSQL recovery, the required write-ahead log (WAL) must also be available.
Keep every required ancestor, even when its date falls outside the requested recovery window. An item outside the closure is only not required by these points in this graph—not approved for deletion.
Frequently asked questions
Editorial questions based on the listed sources and explicitly labeled local examples.
Why can an old base remain required?
A retained incremental backup may still need blocks from that base through its dependency chain. Its age does not remove that dependency.
Does age alone determine removability?
No. A retention decision must account for retained recovery points and their prerequisites. The example computes that closure, not an age-based deletion rule.
What if the dependency graph is incomplete?
Missing prerequisite nodes produce unknown. A node outside the known closure is not a blanket authorization to delete it from a real repository.
Does this plan verify a real restore?
No. Graph reachability does not prove that backup bytes, permissions, WAL or a recovery environment will work. The model performs no restore.
Sources & model boundaries
Primary references used for this explanation. The interactive example is an educational model, not a live check.
- pgBackRest Configuration Reference
Repository differential/full retention options. Retention rules recognize dependencies between backup sets; removing a full base affects dependent backups.
Checked .
- PostgreSQL 18: Continuous Archiving and Point-in-Time Recovery
25.3.3 Making an Incremental Backup. Restoring an incremental backup requires earlier backups supplying omitted blocks; required bases and WAL must remain available.
Checked .