前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >数据库PostrageSQL-错误处理

数据库PostrageSQL-错误处理

作者头像
cwl_java
发布2020-11-16 09:45:35
3520
发布2020-11-16 09:45:35
举报
文章被收录于专栏:cwl_Javacwl_Java

19.14. 错误处理

exit_on_error (boolean) 如果为真,任何错误将中止当前会话。默认情况下,这个值被设置为假,这样只有 FATAL 错误(致命)将中止会话。

restart_after_crash (boolean) 当被设置为真(默认值)时,PostgreSQL将在一次后端崩溃后自动重新初始化。让这个值设置为真通常是将数据库可用性最大化的最佳方法。但是在某些环境中,例如PostgreSQL被集群软件调用时,禁用重启可能很有用,这样集群软件可以得到控制并且采取它认为适当的行动。 data_sync_retry (boolean)

代码语言:javascript
复制
When set to false, which is the default, PostgreSQL will raise a PANIC-level
error on failure to flush modified data files to the filesystem. This causes

the database server to crash. 当设置为false(默认值),PostgreSQL 把修改的数据文件刷新到文件系统失败,将引发PANIC级错误。 这会导致数据库服务器崩溃。

代码语言:javascript
复制
On some operating systems, the status of data in the kernel's page cache is
unknown after a write-back failure. In some cases it might have been entirely
forgotten, making it unsafe to retry; the second attempt may be reported as
successful, when in fact the data has been lost. In these circumstances, the
only way to avoid data loss is to recover from the WAL after any failure is
reported, preferably after investigating the root cause of the failure and
replacing any faulty hardware.
If set to true, PostgreSQL will instead report an error but continue to run so
that the data flushing operation can be retried in a later checkpoint. Only set
it to true after investigating the operating system's treatment of buffered
data in case of write-back failure.
本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2020-11-12 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 19.14. 错误处理
相关产品与服务
数据库
云数据库为企业提供了完善的关系型数据库、非关系型数据库、分析型数据库和数据库生态工具。您可以通过产品选择和组合搭建,轻松实现高可靠、高可用性、高性能等数据库需求。云数据库服务也可大幅减少您的运维工作量,更专注于业务发展,让企业一站式享受数据上云及分布式架构的技术红利!
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档