postgresql – 错误:无法读取关系16631638416564的块4707:成功

postgresql – 错误:无法读取关系16631638416564的块4707:成功,第1张

概述我在Glassfishserver上使用psql 8.1.18.我有这样的查询: select ip,round((select sum(t1.size) from table t1)) from table where date > '2011.07.29' and date < '2011.07.30' and ip = '255.255.255.255' group by ip; 我在Glassfishserver上使用psql 8.1.18.我有这样的查询:
select ip,round((select sum(t1.size) from table t1)) from table where date > '2011.07.29' and date < '2011.07.30' and ip = '255.255.255.255' group by ip;@H_403_2@  

当我运行此查询时,我收到此错误

ERROR:  Could not read block 4707 of relation 1663/16384/16564: Success@H_403_2@  

但是这个查询工作正常:

select ip,round(sum(size)/175) from table where date > '2011.07.29' and l_date < '2011.07.30' and ip = '255.255.255.255' group by ip;@H_403_2@  

我认为这可能是一个数据库错误,我需要从备份恢复表,也许.但首先我需要了解这些损坏的数据存在的位置.有谁知道如何找到1663/16384/16564关系?还是4707块?

编辑:
我试过这段代码:

select relname,relfilenode from pg_class where  relname in ('1663','16384','16564');@H_403_2@  

但它返回:

relname | relfilenode ---------+-------------(0 rows)@H_403_2@ 它看起来像是一个不好的块或索引.    

要查找坏数据,可以查询pg_class视图;

选择oID,来自pg_class的relname,其中oID = 1663或oID = 16564;

看看结果是什么!

如果结果是索引,只需重新创建损坏的索引;

如果结果是一个表,则表示该表的某些数据已损坏,
您可以通过传递那些损坏的数据或将参数“zero_damaged_pa​​ges”设置为on
从最近的备份集恢复表!

有关参数“zero_damaged_pa​​ges”的更多信息
http://www.postgresql.org/docs/9.0/static/runtime-config-developer.html

总结

以上是内存溢出为你收集整理的postgresql – 错误:无法读取关系1663/16384/16564的块4707:成功全部内容,希望文章能够帮你解决postgresql – 错误:无法读取关系1663/16384/16564的块4707:成功所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/sjk/1170149.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-06-02
下一篇2022-06-02

发表评论

登录后才能评论

评论列表(0条)

    保存