pg_restore 无法加载转储

djf*_*dev 2 postgresql

帮助!突然间,我在尝试从转储中恢复本地数据库时收到此错误:

$ 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;
Run Code Online (Sandbox Code Playgroud)

在本地,我运行的是 postgresql 9.6.3。转储来自运行 9.4 的服务器。由于此命令停止工作,我的机器没有已知的配置更改。

我知道这idle_in_transaction_session_timeout是在 9.6 中引入的,但我仍然应该能够加载 9.4 生成的转储。那么什么给呢?

Lau*_*lbe 5

问题是您使用pg_dumpPostgreSQL 9.6 来创建 9.4 数据库的转储。

如果要创建可以加载到 9.4 数据库中的转储,请使用pg_dumpPostgreSQL 9.4。