在包含大约 50 个模式的数据库上进行备份时遇到问题,每个模式有大约 100 个表。
pg_dump 抛出以下错误,建议增加 max_locks_per_transaction
。
pg_dump: WARNING: out of shared memory
pg_dump: SQL command failed
pg_dump: Error message from server: ERROR: out of shared memory
HINT: You might need to increase max_locks_per_transaction.
pg_dump: The command was: SELECT tableoid, oid, prsname, prsnamespace, prsstart::oid, prstoken::oid, prsend::oid, prsheadline::oid, prslextype::oid FROM pg_ts_parser
在 postgresql.conf
中将 max_locks_per_transaction
更新为 256 并没有解决问题。
是否有任何可能导致此问题的可能性?
编辑:(2016 年 5 月 7 日)
PostgreSQL 版本 = 9.1
操作系统 = Ubuntu 14.04.2 LTS
shared_buffers
在 postgresql.conf
= 2GB
编辑:(2016 年 5 月 9 日)
我的 postgres.conf
maintenance_work_mem = 640MB
wal_buffers = 64MB
shared_buffers = 2GB
max_connections = 100
max_locks_per_transaction=10000
最佳答案
您可能需要进一步增加 max_locks_per_transaction
。检查documentation有关此参数含义的详细信息。如果有疑问,请检查您有多少张表并将 max_locks_per_transaction
设置为至少那么多,那么您应该没问题。
关于postgresql - pg_dump 数据库抛出错误 'out of shared memory',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37073166/