品易云推流 关闭
文章详情页
文章 > PostgreSQL > postgresql常见错误

postgresql常见错误

头像

yang

2020-04-06 10:45:403787浏览 · 0收藏 · 0评论

我们在操作数据库的时候,我们总会遇到很多错误。下面整理了一下常见的错误。

错误1

FATAL: connection limit exceeded for non-superusers

原因:非超级用户的连接数(max_connections - superuser_reserved_connections)超过了设定值

解决办法:增加max_connections设定值,但如果增加了过多的话,数据库负担太大还容易产生内存错误。可以记住pg-pool等工具来辅助解决。

错误2

FATAL: sorry, too many clients already

原因:数据库服务器的连接数超过了max_connections设定值。

解决办法:和错误1解决办法类似。

错误3

LOG: checkpoints are occurring too frequently

原因:checkpoint处理正频繁发生。

解决办法:增加checkpoint_segments的值。

错误4

LOG: archive command failed with exit code (X)

原因:archive_command 失败了。

解决办法:因为有可能是硬盘没空间了,所以可以把数据库的log删除一些。

错误5

LOG: number of page slots needed (X) exceeds max_fsm_pages (Y)

原因:max_fsm_pages不足了。

解决办法:增加max_fsm_pages的同时进行 VACUUM FULL。

错误6

ERROR:  operator does not exist: character = integer

原因:PostgreSQL8.3以后,取消了默认类型转换。因此需要使比较的类型保持一致。可以看cast函数。

推荐:PostgreSQL教程

关注

关注公众号,随时随地在线学习

本教程部分素材来源于网络,版权问题联系站长!

底部广告图