在文件头中获取“[archiver] 不受支持的版本 (1.13)"运行 pg_restore 时 [英] Getting "[archiver] unsupported version (1.13) in file header" when running pg_restore
问题描述
我刚刚在 mac os 上升级到 postgres 10.2,它与 heroku 上的 10.2 匹配.我正在尝试下载数据库的副本并在本地恢复它.在升级之前,恢复工作正常.
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.
我跑
pg_restore --verbose --clean --no-acl --no-owner -h localhost -d database_name backup.dump
但我收到此错误:
pg_restore: [archiver] 文件头中不支持的版本 (1.13)
pg_restore: [archiver] unsupported version (1.13) in file header
数据库似乎工作正常.这是一个 rails 应用程序,我升级了 pg gems.我可以运行 rake db:create
和 db:migrate
就好了.
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.
推荐答案
你需要升级你的本地 postgres 以获得 2018-03-01 的最后一个安全补丁,就像 Heroku
做了第一个行进.您需要最新版本 10.3
、9.6.8
、9.5.12
、9.4.17
和9.3.22
.
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
.
可以在此处找到安全补丁 https://www.postgresql.org/about/新闻/1834/.
The security patch can be found here https://www.postgresql.org/about/news/1834/.
看来补丁修改了 pg_dump,这可能就是为什么我们不能在没有该补丁的情况下再使用 pg_restore 来进行 Heroku 的转储(应用了补丁).
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).
这篇关于在文件头中获取“[archiver] 不受支持的版本 (1.13)"运行 pg_restore 时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!