gpt4 book ai didi

postgresql - PG_DUMP 内存溢出错误

转载 作者:行者123 更新时间:2023-11-29 12:11:42 50 4
gpt4 key购买 nike

我正在尝试使用 pg_Dump 备份数据库产品。

数据库的总大小为 1.6 GB。数据库中的一个表是 product_image,它的大小为 1gb。

当我在数据库上运行 pg_dump 时,数据库备份失败并出现此错误。

##pg_dump: Dumping the contents of table "product_image" failed: 
PQgetCopyData
() failed.
pg_dump: Error message from server: lost synchronization with server:
got messag
e type "d", length 6036499
pg_dump: The command was: COPY public.product_image (id, username,
projectid, session, filename, filetype, filesize, filedata, uploadedon, "timestamp") T

如果我尝试通过排除 product_image 表来备份数据库,备份会成功。

我尝试将 postgres.conf 中的 shared_buffer 从 128MB 增加到 1.5gb,但问题仍然存在。如何解决这个问题?

最佳答案

我遇到了同样的错误,这是由于 RedHat 在 6 月初(2015 年)为 OpenSSL 提供了一个错误补丁。有 related discussion在 PostgresSQL 邮件列表上。

如果您使用 SSL 连接并超过传输大小阈值,这取决于您的 PG 版本(PG < 9.4 的默认值为 512MB),隧道会尝试重新协商 SSL key 并且连接会因您发布的错误而终止。

对我有用的修复是设置 ssl_renegotiation_limit在 postgresql.conf 中设置为 0(无限制),然后重新加载。

ssl_renegotiation_limit (integer)

Specifies how much data can flow over an SSL-encrypted connection before renegotiation of the session keys will take place. Renegotiation decreases an attacker's chances of doing cryptanalysis when large amounts of traffic can be examined, but it also carries a large performance penalty. The sum of sent and received traffic is used to check the limit. If this parameter is set to 0, renegotiation is disabled. The default is 512MB.

关于postgresql - PG_DUMP 内存溢出错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31017068/

50 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com