I am using postgresql-9.4 (port 5432) and postgresql-10.0 (port 5433) on my Linux machine (RHEL 7.4). Postgresql-9.4 was installed using yum repository and Postgresql-10.0 was installed using source in different partitions.

I have taken a backup of db (dtbase.backup) on Postgresql-9.4 using it's pg_dump and trying to restore this on Postgresql-10.0 using it's pg_restore.

While doing this, I am getting below error:

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

I have checked different forums but unable to find the solution. Any help would be highly appreciated.

  • Pretty sure that error is telling you that the pg_restore packaged with the postgres 10 install you have doesn't support the dumpfile from the 9.4 version of pg_dump. Did you add any flags to the pg_dump? What flags? – cunninghamp3 May 3 '18 at 11:47
  • pg_dump -i -p 5432 -U postgres -F c -b -v -f – erTugRul May 3 '18 at 11:49
  • But earlier I have restored the same way. Everything went fine. – erTugRul May 3 '18 at 11:50
  • May be a duplicate of stackoverflow question: stackoverflow.com/questions/49064209/… – cunninghamp3 May 3 '18 at 12:05

Your 9.4 installation likely updated to 9.4.17 or greater, introducing a patch that makes the dumps that you make incompatible with postgresql version 10 prior to 10.3 per this stack overflow answer and the postgres announcement it links to.

From the announcement:

One security vulnerability is addressed in this release:
* CVE-2018-1058: Uncontrolled search path element in pg_dump and other client applications

This change breaks compatibility between versions that previously had compatible pg_dump/pg_restore workflows unless both versions have been updated to include the CVE patch.

You may want to consider upgrading your version 10 install to be installed from yum as well. I don't have experience with version 10 yet, but most likely postgres has continued to version the directories that the installation goes into, so you should be able to have both 9.4 and 10.3 installed from yum (and get security patches much more easily than rebuilding from source!).


I have solved it without upgrading. I took backup again using pg_dump of 10.0 instead of 9.4 and pg_restore worked this time.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.