PostgreSQL 13, released on September 24, 2020, adds pg_verifybackup to check backups made with pg_basebackup. Database operators can compare a backup with the server’s record of what it sent. The --skip-checksums option avoids reading data-file contents, but gives up the checksum comparison that can expose changed contents. Even the fuller check does not replace a test restore. This retrospective uses the dated release announcement and the REL_13_0 manual pinned to its release commit, both retrieved later; no separate publication date has been established for that manual. [S1][S3]
The new command needs a backup_manifest generated by the server when the backup was taken. It reads that manifest first and stops with a fatal error if the file is missing, unreadable, malformed or fails its own internal checksum. The backup must be in plain format; a tar-format backup has to be extracted before checking. [S3]
By default, pg_verifybackup compares file checksums with the values recorded in the manifest, apart from files it has already rejected or is instructed to ignore. With --skip-checksums, file-presence and size checks remain, but data-file checksums are not verified. The release’s manual describes that mode as much faster because the files themselves do not need to be read. A file can retain its size while its contents change, so a successful size check cannot provide the same assurance as comparing its checksum. The documentation supplies no timing estimate for a particular backup. [S3]
Recovery logs are checked separately. The manifest identifies the write-ahead log, or WAL, records needed to recover the backup, and pg_verifybackup invokes pg_waldump to check that those records can be read and parsed. --no-parse-wal is the separate option that disables this step; --skip-checksums is not its replacement. Extra WAL files that are not needed to recover the backup are outside this check. WAL verification is also version-specific, so the checking tools must match the backup’s PostgreSQL version. [S3]
The file comparison has exclusions worth knowing before treating its result as an inventory of everything in the backup directory. It ignores changes to postgresql.auto.conf, standby.signal and recovery.signal, which may legitimately change during backup preparation. Files inside pg_wal are excluded from that comparison, although the required recovery records receive the separate WAL check. Directories are not checked directly: a missing directory is detected indirectly when files that should be inside it are missing. [S3]
A clean verification result still leaves a recovery question. PostgreSQL’s version 13 manual explicitly says the tool cannot perform every check a running server makes when using a backup. It calls for test restores, checking that the restored databases work as expected and appear to contain the right data. For an operating procedure, record whether checksums and WAL parsing ran, then keep the restore rehearsal as a separate acceptance step. [S3]
Source documents
- PostgreSQL 13 Released!https://www.postgresql.org/about/news/postgresql-13-released-2077/
- PostgreSQL 13 pg_verifybackup manual — REL_13_0https://raw.githubusercontent.com/postgres/postgres/29be9983a64c011eac0b9ee29895cce71e15ea77/doc/src/sgml/ref/pg_verifybackup.sgml
