Apr 4, 2011
Nathan Thom

pg_restore: [archiver] unsupported version (1.12) in file header


I had a binary formatted dump file from some unknown developer’s PostgreSQL server. It needed to be restored to a server running an old 8.3 version. When I tried to restore it I got an error:

$ pg_restore -d rc -Fc dump.backup
pg_restore: [archiver] unsupported version (1.12) in file header
$ pg_restore --version
pg_restore (PostgreSQL) 8.3.13

So I probably have a version mismatch, but what where does it get 1.12 from? After some googling I found that 1.12 actually means 9.0 (naturally), so I used the 9.0 version of pg_restore to convert my binary file into a plan SQL file via the -f parameter.

$ pg_restore --version
pg_restore (PostgreSQL) 9.0.3
$ pg_restore -Fc dump.backup  -f dump.sql

Copy dump.sql back to 8.3 server

$ psql rc -f out.sql

Worked fine. I’m sure I’ve moaned about the lack of options in pg_restore before, but this helped restore my faith in it a little bit :)

Related posts:

  1. pg_restore hanging on remote create index
  2. Query version and OS via psql
  3. PSQL Not Running First Statement In Script
  4. Prevent firewall timeouts with psql
  5. Custom PostgreSQL RPM to Install Multiple Versions
  6. Top 10 Missing PostgreSQL Features
  7. Modifying Data – Multi Version Concurrency (MVCC)
  8. Compare pg_dump and gzip compression

1 Comment

  • Thank you for this extremely useful post. In my case (v.9.0) I have to execute:

    pg_restore -f dump.sql -Fc dump.backup

    (arguments are switched) and drop “rc” from psql command.

    Thank you again very much!

Leave a comment

Article Series

Kick Ass PostgreSQL Books

Kick Ass Oracle Books

I've read lots of Oracle books, but these are by far the best I've encountered:

Categories