Skip to content
WebsiteHosting.com

comparison Data & storage

Database backups, snapshots and consistency

A snapshot can be part of a backup, but its existence proves neither consistency nor recovery. The base copy must meet engine requirements, and required change logs must cover the recovery target.

Latest recorded source check · P0073

What it means

A snapshot describes a captured storage state; a recoverable backup describes what you can reconstruct from preserved data. These are not opposing product categories. A snapshot may contribute the starting copy, but you still need evidence that the copy meets the database engine's requirements and supports the intended recovery method.

For the PostgreSQL 18 physical recovery method discussed here, compare the evidence rather than the labels:

Recovery questionSnapshot by itselfCompatible physical base plus required archived WAL
Is the starting state suitable?Capture alone does not establish this; engine requirements still matter.Base suitability is a prerequisite, not something the logs prove.
Can you reach a later target?The snapshot alone does not provide subsequent changes.The required unbroken sequence supplies the path to the target.
Has recovery actually succeeded?Snapshot creation is not a restore test.Having the inputs is still not a restore test.

The simulation isolates the middle question. By assuming a valid base, it lets you see exactly why missing history changes the reachable target without pretending to validate the starting copy.

For a PostgreSQL 18 filesystem-level backup, a usable starting copy must cover the whole database cluster and the files needed for recovery, not an arbitrary subset of relation files. A live snapshot must be consistent across the relevant data, WAL and tablespace storage; taking unrelated volume snapshots at different times does not establish that condition. The lab assumes a valid starting snapshot. Its time-window calculation cannot repair an inconsistent base copy.

Try it

Simulation: change Missing segment from 3 to none, then inspect the current result and its explanation. Use Compare with baseline to display the baseline and current outcomes together. This is a local calculation, not a backup check or restore. Without JavaScript, the initial example remains readable, but the controls are unavailable.

Find the recovery boundary of a log sequence

Change one condition and inspect the computed result, its cause, and the model boundary.

Simulation

Invented complete base at minute 0 and one log segment per following minute. Continuous segment coverage is necessary here, not proof that real PostgreSQL backups are restorable.

Requested recovery target is not covered

Base: minute 0. Available log segments: 1, 2, 4, 5, 6. The uninterrupted chain ends at minute 2; target is minute 5.

A later archived segment cannot fill an earlier gap. Locate the missing evidence; do not claim point-in-time recovery from snapshot existence alone.

Find the recovery boundary of a log sequence: supplied inputs
InputSupplied value
Requested recovery minute5
Last archived log minute6
Missing segment3
Find the recovery boundary of a log sequence: synthetic inputs

Synthetic local learning example. No account, real network, server, filesystem, credential, command or production change is accessed.

About this model

Invented complete base at minute 0 and one log segment per following minute. Continuous segment coverage is necessary here, not proof that real PostgreSQL backups are restorable.

These are bounded teaching rules. Actual behavior needs the linked subject specifications and independent observations. The examples are not live checks.

Requested recovery target is not covered. Base: minute 0. Available log segments: 1, 2, 4, 5, 6. The uninterrupted chain ends at minute 2; target is minute 5. A later archived segment cannot fill an earlier gap. Locate the missing evidence; do not claim point-in-time recovery from snapshot existence alone.

Keep Requested recovery minute = 5 and Last archived log minute = 6. The assumed valid base stays fixed at minute 0; only the presence of segment 3 changes.

Reset restores Requested recovery minute = 5, Last archived log minute = 6, and Missing segment = 3. It removes input errors, clears the comparison, and returns the displayed result to the baseline. There is no running clock or stored event history. Reset preserves your independent choices to open or close FAQ answers and About this model.

How it works

The model separates a starting state from the changes needed after it. It assumes the base at minute 0 is already valid. Each later segment supplies the next step in reconstructing the state, so the calculation first finds how far the sequence remains uninterrupted and only then compares that boundary with the target.

With segment 3 missing, segments 1 and 2 connect to the base, but segments 4, 5, and 6 sit beyond a break. Their presence does not establish the missing transition. The modeled chain therefore ends at minute 2, even though the archive contains a segment labeled 6. A target at minute 3 is already beyond that boundary; the failure is not specific to the default target of minute 5.

This illustrates the dependency behind PostgreSQL 18's physical base-backup and archived write-ahead log (WAL) recovery method: the needed sequence must be available from a compatible base. It does not establish that a particular snapshot supplies that base. Consistency of the starting copy, continuity of the required history, and successful recovery are separate questions. Passing the continuity check cannot repair an unsuitable starting copy or stand in for a restore test.

Worked example

This is a synthetic sequence, not an observation of a database or backup service.

InputBaseline value
Requested recovery minute5
Last archived log minute6
Missing segment3

The assumed base is at minute 0. Available log segments are 1, 2, 4, 5, 6. Following the sequence from the base reaches minute 2, then stops because segment 3 is absent. The requested target, minute 5, lies beyond that boundary, so the result is Requested recovery target is not covered.

The useful distinction is between the newest available segment, 6, and the last continuously reachable minute, 2. Only the second answers whether this modeled base can reach the target.

What changes when the condition changes

Change Missing segment to none. Keep Requested recovery minute = 5 and Last archived log minute = 6.

Target covered by the modeled log chain. Base: minute 0. Available log segments: 1, 2, 3, 4, 5, 6. The uninterrupted chain ends at minute 6; target is minute 5.

The change supplies segment 3, connecting segments 1–2 to segments 4–6. The target becomes covered because the dependency gap has closed, not because the newest archived minute has increased. Real backup validity, timelines, checksums, configuration and an isolated restore still need verification.

In practice

For a PostgreSQL 18 recovery assessment, begin with read-only access that you are authorized to use. Identify the proposed physical base, database version, required archived WAL, recovery timeline, and target. Record which evidence establishes base compatibility and log continuity. PostgreSQL 18's filesystem-level backup section, 25.2, addresses the starting copy; continuous archiving and recovery, section 25.3, addresses the base-and-WAL recovery method.

The expected planning result is an identified starting point and a supported path to the requested target—not merely a successful snapshot job or a recently archived file. STOP if the base's suitability, required sequence, or timeline is unknown. Preserve the source database, backups, and archives; do not overwrite them or discard logs on the strength of this simulation.

A real restore is outside this page's procedure. Before commissioning one, require an authorized, platform-specific plan naming the exact backup set, target, and isolated nonproduction destination. Confirm the operator's restore permissions and preserve any destination state that must survive the test. Production switching requires separate authorization; permission to run a drill is not permission to replace the live database.

Verify the recovered state against the requested target and test the required application behavior. If the result differs or isolation is uncertain, stop rather than promoting the restored system. The plan must also define rollback for the test destination: return it to its preserved before-state, or recreate it only if it was explicitly disposable. After rollback, verify that the destination is in the intended state and that production and the source backup artifacts remain unchanged.

Limits and unknowns

The controls accept Requested recovery minute and Last archived log minute in the labeled 0–10 range, with Missing segment set to none, 3, or 5. Empty or invalid input removes the calculated outcome until you correct it or use Reset; an earlier valid result must not be treated as the answer to an invalid draft.

For valid inputs, this model answers only whether the target is covered by its assumed sequence. It does not inspect a real backup or produce a real-world recovery diagnosis. If you do not know whether an actual base is usable or whether all required logs are present, recoverability remains unknown—not proven by either modeled verdict.

The one-segment-per-minute representation is deliberately unlike the layout of real PostgreSQL WAL files. A real archive's file count or newest timestamp cannot be substituted directly for these minute values. Compatibility, integrity, configuration, timelines, and a verified isolated restore remain outside the calculation.

What to carry forward

Judge a recovery option by the starting state it can restore, the uninterrupted history needed to reach your target, and the evidence from an isolated recovery test—not by whether it is called a snapshot or a backup. Your next safe step is to identify those three kinds of evidence. If any is missing, keep the recovery claim qualified rather than treating the newest archive file as proof.

Frequently asked questions

Editorial questions, answered from the sources listed for this article.

Does a snapshot alone allow recovery to every later instant?

No. Even a snapshot that is usable as a base does not contain changes made after it. Reaching a later PostgreSQL recovery target requires the applicable change history and recovery procedure. The snapshot's timestamp is not evidence that recovery is possible through the present.

Can PostgreSQL replay archived WAL onto a plain pg_dump output?

No. A plain pg_dump output is a logical dump, not the physical base required by PostgreSQL 18's continuous-archiving recovery method. Having both a dump file and archived WAL does not make them a compatible base-and-log recovery set.

Can later log segments make an earlier missing segment irrelevant?

Not if the missing segment is required between the chosen base and the target. Later segments cannot replace it. A separately validated base that does not require the missing segment would change the recovery chain being assessed; it would not repair the original chain. This lab cannot explore that alternative because its base is fixed at minute 0.

Does complete log coverage prove that a restore test passed?

No. Complete coverage is evidence about available inputs, not an observed recovery result. A useful drill records the backup set and target tested, the state actually recovered, and the required application checks. A successful result supports that tested case; it does not establish that every backup or recovery target will work.

Sources & model boundaries

Primary references used for this explanation. The interactive example is an educational model, not a live check.

  1. PostgreSQL 18: continuous archiving and PITR

    25.3: base backup, archived WAL and recovery. A compatible base and an unbroken needed log sequence are required

    Checked .

  2. PostgreSQL 18: filesystem-level backup

    25.2 File system level backup; 25.2 File System Level Backup. Backup consistency and engine requirements matter beyond copying files; A physical base copy must cover the whole cluster and required WAL; a live snapshot must be consistent across relevant storage. The lab assumes a valid base and cannot prove its consistency.

    Checked .

  3. AWS reliability: test disaster recovery

    REL13: test recovery implementation. A documented plan or backup job is not an observed recovery drill

    Checked .