2

I want to restore a database in PostgreSQL but it can't. I have replaced pg_restore in bin folder but it's still not working. The message is :

pg_restore: [archiver] unsupported version (1.12) in file header
Nicolás Ozimica
  • 9,481
  • 5
  • 38
  • 51
Nike
  • 101
  • 1
  • 2
  • 3
  • this might be able to help you out: http://stackoverflow.com/questions/4599696/use-pg-restore-to-restore-from-a-newer-version-of-postgresql/4599831#4599831 – corroded Apr 25 '11 at 04:02
  • put your original (newer) `pg_restore` back and do `pg_restore --help` -- look for a `-i` option. – vladr Jun 11 '11 at 04:45

2 Answers2

1

I solved this by upgrading postgresql from 8.X to 9.2.4. If you're using brew on Mac OS-X, use -

brew upgrade postgresql

Once this is done, just make sure your new postgres installation is at the top of your path. It'll look something like (depending on the version installation path) -

export PATH=/usr/local/Cellar/postgresql/9.2.4/bin:$PATH
Blake
  • 2,357
  • 3
  • 25
  • 35
0

This occurs when the archive was created with a version newer than the pg_restore you are using can support. The best way to fix this is to install a newer version of pg_restore. Note that this limitation has more recently gone away. I can use pg_restore from 9.1 against a 9.2 custom dump file for example.

Chris Travers
  • 25,424
  • 6
  • 65
  • 182