Issue
Occasionally Postgres changes require changes to the file format used by pg_dump
and pg_restore
utilities. When this happens, a backup created by an older version of pg_dump
will throw an error if you try to restore with an older version of pg_restore
.
Example of potential error:
pg_restore: [archiver] unsupported version (1.14) in file header
Resolution
How do I resolve this issue when attempting a restore with pg_restore?
This error is caused by a version mismatch between the version of pg_dump
used to create the backup file and the version of pg_restore
used to attempt the restore. Because of this you will need to download and use the version of pg_restore
that matches the version of pg_dump
used to create the backup file.
If you don't know which version of pg_dump
was used, you will likely need to refer to the Postgres archive format source code to determine what version your archive format was introduced in.
How do I resolve this issue when attempting a restore with PGBackups?
PGBackups uses the version of pg_dump
and pg_restore
that match the database you are performing the action (restore or dump) against. If you receive this error while attempting to restore a backup using PGBackups, it may be because you are attempting to restore to a version of Postgres older than the version of Postgres which the backup was taken from. When this happens you will need to upgrade your target database or attempt the restore from your personal machine, using the version of pg_restore
that matches the version of your source database.