0

I'm using a Linux server, I want to upgrade postgresql from the version 9 to 11. I have created a dump of my database. Then I have installed postgresql 11, now I want to import the dump to postgresql 11, I run the command

pg_restore -h localhost -d dbLitstUsers -U postgres .dataBasebackup but get the error

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

How can I fix this error ?

5
  • you need to take the backup with pg_dump from version 11. But why not go straight to 14? Commented Jun 4, 2022 at 13:41
  • this is the choice of the client to upgrade to the version 11 Commented Jun 4, 2022 at 13:48
  • pg_dump is used to extract a PostgreSQL database not to import a database Commented Jun 4, 2022 at 13:54
  • Yes, but you need to do it with the one from the target version Commented Jun 4, 2022 at 14:56
  • I can only warn against upgrading to v11. Use a more recent version. Commented Jun 4, 2022 at 20:28

1 Answer 1

0

You must have used a pg_dump from v12 or higher. That generates a custom dump in a format (1.14) which is not compatible with older pg_restore. Retake the dump with the pg_dump coming with the version you want to restore to.

Sign up to request clarification or add additional context in comments.

1 Comment

Or use the same version of pg_restore to do the restore.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.