Queries against one table fail with "ERROR: invalid page in block 48213 of relation base/16384/24576".
AdvancedTroubleshootingData loss and corruption
Answer
Likely causes → Physical corruption on disk: a storage or controller fault, a crash with fsync disabled, a bad volume restore, or a filesystem bug. Postgres page checksums detected it.
Diagnose →
SELECT relname FROM pg_class WHERE relfilenode = 24576;
SHOW data_checksums;
pg_amcheck --all --heapallindexed -d app
dmesg -T | grep -iE 'i/o error|ext4|xfs'
Check whether replicas have the same problem (physical replicas can copy corruption; logical ones usually don't).
Fix → Fail over to a healthy replica if it's clean, or restore from backup plus WAL to just before the corruption. Only as a last resort, to save what's left, use zero_damaged_pages = on on a copy and dump the readable rows; that permanently drops the damaged pages.
Prevent → Enable data checksums, never run with fsync = off, run pg_amcheck regularly, and keep tested backups with WAL archiving.
More on Data loss and corruption
An engineer ran `DELETE FROM orders;` on the production Postgres (forgot the `WHERE`) at 14:32.BeginnerA cleanup script deleted every object under `s3://acme-invoices/2025/`. Versioning is enabled.BeginnerYou need to restore last night's MySQL backup and discover the dump files for the past three months are 20 KB each.IntermediateUsers update their profile, the page reloads, and they see the old values; a minute later the new values show up.IntermediateA network partition between data centres lasted 4 minutes; afterwards you find both sites accepted writes as primary, and the same order IDs exist with different contents.AdvancedA deploy ran a migration that dropped the `phone` column; old pods still running during the rolling update threw 500s, and a background job wrote nulls into a new table.Intermediate