开发者社区> 问答> 正文

再现postgresql奇怪问题? 400 报错

再现postgresql奇怪问题? 400 报错

对表tbName进行如下查询时没有任何问题
select age from tbName where id =13; select count(age) from tbName where id =13; select * from tbName where id =13; select max(age) from tbName;


但是下面这个查询就出错
select max(age) from tbName where id =13;


错误信息:
PANIC:  corrupted item pointer: 96
server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
The connection to the server was lost. Attempting reset: Failed.

请大家知道的和不知道的都来帮帮忙看看可能是什么原因把

展开
收起
爱吃鱼的程序员 2020-06-05 13:26:36 976 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    你的磁盘出了问题,对应的页面出了问题。 有个参数可以解决,但是需要比较谨慎,建议先备份数据库然后再进行操作

    zero_damaged_pages (boolean)

    Detection of a damaged page header normally causes PostgreSQL to report an error, aborting the current transaction. Setting zero_damaged_pages to on causes the system to instead report a warning, zero out the damaged page in memory, and continue processing. This behavior will destroy data, namely all the rows on the damaged page. However, it does allow you to get past the error and retrieve rows from any undamaged pages that might be present in the table. It is useful for recovering data if corruption has occurred due to a hardware or software error. You should generally not set this on until you have given up hope of recovering data from the damaged pages of a table. Zeroed-out pages are not forced to disk so it is recommended to recreate the table or the index before turning this parameter off again. The default setting is off, and it can only be changed by a superuser.

    ######

    @Galy ?这么长时间过去了没人理。你怎么会突然跑过来回答这样一个几乎没人愿意回答也几乎没人能回答的问题呢?

    不过,你的回答确实很一针见血。 这个问题我当时也没有彻底解决,但是我印象中我查过的英文资料中确实有很大的倾向指向了和你相同的回答。但是由于我英文还不是很好、加上我对很深的东西还不太懂,就没有继续彻底研究下去。

    我还以为不会有人对这类问题感兴趣了呢。先谢谢你了啊。以后有时间我再好好看一下。

    ######

    啊?!原来是专家啊!!

    然您亲自光临寒舍,真是三生有幸啊。。。

    先膜拜了!!

    2020-06-05 13:26:51
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
金融级 PostgreSQL监控及优化 立即下载
PostgreSQL在哈啰的实践-周飞 立即下载
PostgreSQL高并发数据库应用数据 立即下载

相关镜像