如果在读取数据库路由器中的django查询中发生操作错误,请在写入数据库上重新运行查询
当从read_db()路由器中读取查询时,由于以下错误
ERROR: cancelling statement due to conflict with recovery
Detail: User query might have needed to see row versions that must be removed
如何捕获错误并在写入db上重试相同的查询。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
请注意,这不是Django问题,而是PostgreSQL。
两个解决方案是:
请参阅文档:
Please note, this is not a Django problem, but PostgreSQL.
Two solutions are:
See docs:
https://www.postgresql.org/docs/current/runtime-config-replication.html