首页 > 解决方案 > Rails Backup Gem 无法在从属设备上备份复制的 PostgreSQL 数据库,出现 pg_dump 权限错误

问题描述

运行备份失败并出现以下错误:

pg_dump: Error message from server: ERROR:  canceling statement due to conflict with recovery
DETAIL:  User query might have needed to see row versions that must be removed.
Errno::EPERM: Operation not permitted - 'pg_dump' returned exit code: 1

即使用户有权访问数据库上的 pg_dump

这是一个复制的数据库,备份过程在从属服务器上运行。

标签: postgresqlpg-dump

解决方案


为了使这项工作你必须启用

hot_standby_feedback = on

代替

/etc/postgresql/SQL_VERSION/main/postgresql.conf

然后使用重新启动postgresql

systemctl restart postgresql

推荐阅读