postgresql - pg_restore 加载转储失败

标签 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;

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

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

最佳答案

问题是您使用了 PostgreSQL 9.6 中的 pg_dump 来创建 9.4 数据库的转储。

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

关于postgresql - pg_restore 加载转储失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44770798/

相关文章:

postgresql - 使用 postgres tablefunc crosstab() 返回空单个值

ruby-on-rails - 尝试 db :migrate inside of heroku, 迁移失败

java - PSQL异常 : ERREUR: realtion "table" doesn't exist

sql - PostgreSql 表中 UUID、CHAR 和 VARCHAR 之间的性能差异?

postgresql - PostgreSQL外键违规的原因?

java - 连接到 <主机名> :5432 refused

python - sqlalchemy 的 create_all 不会自动创建序列

postgresql - 是否可以使用 Hibernate 注释定义 INITIALLY DEFERRED 约束?

sql - 具有字符串路径的分层数据 - 查询节点,获取所有父节点及其节点的第一级

mysql - 将 int-hash 列添加到 small-ish char/binary 列会提高检索性能吗?