Getting “[archiver] unsupported version (1.13) in

2019-03-08 01:27发布

I just upgraded to postgres 10.2 on mac os which matches 10.2 on heroku. I'm trying to download a copy of the database and restore it locally. Before the upgrade the restore would work fine.

I run

pg_restore --verbose --clean --no-acl --no-owner -h localhost -d database_name backup.dump

but I am getting this error:

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

The database appears to be working OK. It's a rails app and I upgraded the pg gems. I can run rake db:create and db:migrate just fine.

12条回答
The star\"
2楼-- · 2019-03-08 01:31

Had this problem on Windows using pgAdmin 3.

Upgrading from pgAdmin 3 to pgAdmin 4 solved the problem for me.

If you are using a third-party tool, such as PgAdmin, to restore the provided dump file, the restore may not succeed even with the installed Postgres version being up to date. This is due to third-party tools often bundling their own versions of the pg_restore binary, that may not be up to date. https://help.heroku.com/YNH1ZJUS/why-am-i-getting-pg_restore-archiver-unsupported-version-1-13-in-file-header-error-with-pg_restore

查看更多
时光不老,我们不散
3楼-- · 2019-03-08 01:32

You need to upgrade your local postgres to get the last security patch from the 2018-03-01, like Heroku did the 1st march. You need one of the last releases 10.3, 9.6.8, 9.5.12, 9.4.17, and 9.3.22.

The security patch can be found here https://www.postgresql.org/about/news/1834/.

It seems the patch modified pg_dump, that's probably why we can't use pg_restore anymore without that patch for the dump of Heroku (with the patch applied).

查看更多
叛逆
4楼-- · 2019-03-08 01:32

You're using an old version of pg_restore binary that doesn't support restoring the provided dump file. Please make sure that you use the latest Postgres version, which must be higher than the following release: https://www.postgresql.org/about/news/1834/ (10.3, 9.6.8, 9.5.12, 9.4.17, and 9.3.22).

You can check the pg_restore version you're using by running pg_restore --version.

If you are using a third-party tool, such as PgAdmin, to restore the provided dump file, the restore may not succeed even with the installed Postgres version being up to date. This is due to third-party tools often bundling their own versions of the pg_restore binary, that may not be up to date.

查看更多
可以哭但决不认输i
5楼-- · 2019-03-08 01:32

I was encountering the same error. I updated to postgresql 10.3 locally, and that fixed the problem for me.

查看更多
SAY GOODBYE
6楼-- · 2019-03-08 01:36

Since yesterday (03/01/2018) we also had problems restoring a backup from Heroku running on PostgreSQL 9.5:

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

Upgrading our PostgreSQL version from 9.5.11 to 9.5.12 fixed the issue.

查看更多
干净又极端
7楼-- · 2019-03-08 01:39

The fix for me involved both updating my Postgres.app and updating my local homebrew PostgreSQL.

Update my Postgres.app via Canuk's answer:

Open Postgres.app > Check for updates...

Update my local homebrew PostgreSQL via gerry3's comment on the accepted answer:

brew upgrade postgresql brew postgresql-upgrade-database

查看更多
登录 后发表回答