简体   繁体   English

pg_restore无法加载转储

[英]pg_restore failing to load dump

Help! 救命! All of a sudden, I'm getting this error when trying to restore my local DB from a dump: 突然,尝试从转储中还原本地数据库时出现此错误:

$ pg_restore --no-acl --no-owner --dbname my_db tmp/latest.dump
pg_restore: [archiver (db)] Error while INITIALIZING:
pg_restore: [archiver (db)] could not execute query: ERROR:  unrecognized configuration parameter "idle_in_transaction_session_timeout"
Command was: SET idle_in_transaction_session_timeout = 0;

Locally, I'm running postgresql 9.6.3. 在本地,我正在运行PostgreSQL 9.6.3。 The dump comes from a server that is running 9.4. 转储来自运行9.4的服务器。 No known configuration changes to my machine since this command stopped working. 由于此命令停止工作,因此我的计算机没有已知的配置更改。

I understand that idle_in_transaction_session_timeout was introduced in 9.6, but I should still be able to load a dump generated by 9.4. 我了解到9.6中引入了idle_in_transaction_session_timeout ,但是我仍然应该能够加载9.4生成的转储。 So what gives? 那有什么呢?

The problem is that you used pg_dump from PostgreSQL 9.6 to create the dump of the 9.4 database. 问题是您使用了PostgreSQL 9.6的pg_dump来创建9.4数据库的转储。

If you want to create a dump that you can load into a 9.4 database, use pg_dump from PostgreSQL 9.4. 如果要创建可以加载到9.4数据库中的转储,请使用PostgreSQL 9.4中的pg_dump

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM