再现postgresql奇怪问题

wsg 发布于 2012/07/23 11:50
阅读 5K+
收藏 0
对表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.

请大家知道的和不知道的都来帮帮忙看看可能是什么原因把
加载中
1
Galy
Galy
你的磁盘出了问题,对应的页面出了问题。 有个参数可以解决,但是需要比较谨慎,建议先备份数据库然后再进行操作
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.

0
wsg
wsg

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

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

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

0
wsg
wsg

啊?!原来是专家啊!!

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

先膜拜了!!

返回顶部
顶部