Diagnostic Queries
Symptoms
PostgreSQL read a data page that failed its validity/checksum checks. This indicates corruption, so it raises SQLSTATE XX001 (data_corrupted).
- A page in a relation failed validation.
- Often a checksum failure or a torn/garbage page.
- Reads of the affected block fail.
What the server log shows
ERROR: invalid page in block 12345 of relation base/16384/24576
Why PostgreSQL raises this — what the manual says
the Data Checksums documentation:
“By default, data pages are protected by checksums, but this can optionally be disabled for a cluster.”
Each page carries structural fields (and optionally a checksum). When a read finds an invalid header or checksum mismatch, PostgreSQL refuses to return possibly corrupt data and reports XX001.
Common causes
- Storage/hardware faults corrupting pages.
- Crashes with fsync disabled, or a bad restore.
- Bit rot or controller/firmware bugs.
How to fix it
- Investigate hardware/storage health immediately.
- Restore the affected relation/database from a known-good backup.
- As a last resort,
zero_damaged_pagescan read past it (data loss) — back up first and use with extreme care.
Related & next steps
Reference: PostgreSQL 18 Section 30.2 “Data Checksums”.
Thanks — noted. This helps keep the database accurate.