← All guides

Fixing pg_dump/pg_restore version mismatch errors

"server version mismatch" and "unsupported version in file header" explained — why they happen and the version-matching rules that prevent them.

The two errors

pg_dump: error: server version: 16.4; pg_dump version: 14.11
pg_dump: error: aborting because of server version mismatch

pg_dump refuses to dump a server NEWER than itself. And on restore:

pg_restore: error: unsupported version (1.16) in file header

means the archive was written by a newer pg_dump than the pg_restore reading it.

The rules

1. pg_dump major ≥ server major (newer pg_dump dumping an older server is fine and recommended).
2. pg_restore major ≥ the pg_dump major that wrote the archive.
3. You can restore INTO any version ≥ the source's features; upgrading via dump/restore is standard practice.

Getting the right binaries

On Debian/Ubuntu, the PGDG repo installs side-by-side versions under /usr/lib/postgresql/<major>/bin:

sudo apt install postgresql-client-16
/usr/lib/postgresql/16/bin/pg_dump --version

Pin the full path in scripts — pg_dump on PATH is whatever apt felt like.

Firedrill detects your server major at connect time and always uses matched binaries (14–17), so this class of failure can't reach your backups.

A backup you've never restored is a hope, not a backup.

Firedrill restore-tests every backup it takes — on real infrastructure, with the report to prove it.