Skip to content- Sources: primary
- Summary: Pettus removed the middle 1GB file of a three-segment table in a restored base backup on PostgreSQL 18.6 and 19rc1: sequential scans and pg_dump returned only the first file's 917,504 rows without error, and pg_checksums and pg_amcheck passed. Later inserts reused the lost block numbers so index lookups returned wrong rows, and WAL replay recreated the segment as zeroed pages, while only pg_verifybackup against the backup manifest flagged the missing file. He also shows that packaged pg_checksums, pgBackRest and WAL-G assume 1GB segments and misreport or corrupt clusters built with other sizes.
- Why it matters: After any file-level copy or restore, run pg_verifybackup against the manifest before starting the server, because a successful start proves nothing about missing segments.
- Background: PostgreSQL stores each table or index as files of segment_size, 1GB by default, named after the relation's filenode with .1, .2 suffixes. The server keeps no authoritative length, so it measures files in order until one is short or absent. segment_size is fixed at compile time with --with-segsize and cannot be changed in postgresql.conf.