﻿# PostgreSQL base backups now count checksum failure on a single page

A one-page checksum failure now reaches pg_stat_database during base backup; the counter is diagnostic evidence, not a repair of damaged data.

Author: Retrivium team
Updated: 2026-11-15
Canonical URL: https://retrivium.ai/journal/week46-ops-postgres-basebackup-single-page-checksum/
Language: en

PostgreSQL 18.7 fixes checksum-failure reporting during base backups. A logic error meant pg_stat_database counted failures only when more than one page in the same file was corrupt. A single damaged page could therefore be missing from that counter. The operational lesson is about the detection threshold: an apparently quiet aggregate did not establish clean backup input, and a small corruption fixture is essential to qualify the repaired reporting path.

## One bad page is not a minor version of two

The release identifies the same-file threshold explicitly. A regression matrix should include one corrupt page, two corrupt pages in one file and a clean control. Testing only a heavily damaged file could pass before the patch. A proposed isolated fixture must avoid production data and establish the expected checksum result independently, so a zero count is not misread as correctness when the corruption setup itself failed to reach the checked path.

## Observe the reporting target directly

The entry names pg_stat_database, so a qualification record should read the relevant database statistics before and after backup and account for reset boundaries. A log message elsewhere is useful but does not prove the counter changed. Conversely, an increment may reflect an unrelated concurrent operation unless the fixture is isolated. Preserve database identity, backup timing and baseline values so the delta can be attributed to the intended one-page case.

## Detection does not make the backup usable

The patch repairs accounting of checksum failures; it does not restore the damaged page or certify the output artifact. An operational response still needs to assess source integrity and the backup’s recovery suitability. Keep the reporting check separate from any repair or restore exercise. The release does not prescribe a universal response to every checksum error, so a targeted test should avoid presenting one counter increment as successful data recovery.

## Alert confidence depends on detector coverage

After updating, a checksum alert based on the counter covers the repaired one-page case as well as the previously visible larger case. It still depends on the relevant check being performed and statistics being collected. The absence of an alert is not a general integrity proof for every stored page. The practical contribution is closing a specific reporting blind spot, with controlled negative and positive cases that make the new detector boundary reviewable.

## Sources

- [PostgreSQL 18.7 release notes](https://www.postgresql.org/docs/release/18.7/)
- [PostgreSQL upstream change 39faf4de2](https://postgr.es/c/39faf4de2)

## Related reading

- [Prometheus query warnings: successful status can accompany incomplete results](/journal/field-observe-query-api-warnings-coverage/)
- [A consistent PostgreSQL restore can predate a document deletion](/journal/field-sovereign-postgres-recovery-target-deleted-document-eligibility/)
