开发者社区> 问答> 正文

postgresql 插入执行失败

smithdep 2015-12-22 09:38:06 3082

Caused by: org.postgresql.util.PSQLException: ERROR: unexpected data beyond EOF in block 0 of relation base/18101/63191
Hint: This has been seen to occur with buggy kernels; consider updating your system.
Where: SQL statement "insert into tb_conf_attribute(confid,attrid,attrvalue) values(72141388,1,'true'),**"
PL/pgSQL function createorupdateconf(text,text,text,text,integer,integer) line 12 at EXECUTE statement

SQL 关系型数据库 PostgreSQL Perl
分享到
取消 提交回答
全部回答(2)
  • smithdep
    2019-07-17 18:20:31

    @digoal Linux version 3.2.0-67-generic (buildd@brownie) (gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) ) #101-Ubuntu SMP Tue Jul 15 17:46:11 UTC 2014 我们有多台服务器,系统和数据库的版本都是一样的,这次移植到新服务器出现这个问题。 至于zero_damaged_pages这个参数应该没有设置


    @digoal zero_damaged_pages参数是设置成的false,至于升级内核,具体是要升级到什么版本?

    0 0
  • 德哥
    2019-07-17 18:20:31
    1. 什么操作系统内核版本?
    2. 有没有打开参数zero_damaged_pages?

    从现象来看,建议你确认一下zero_damaged_pages这个参数是否打开,如果打开了,请关闭它。
    如果没有打开,建议你升级内核。

                    /*
                     * We get here only in the corner case where we are trying to extend
                     * the relation but we found a pre-existing buffer marked BM_VALID.
                     * This can happen because mdread doesn't complain about reads beyond
                     * EOF (when zero_damaged_pages is ON) and so a previous attempt to
                     * read a block beyond EOF could have left a "valid" zero-filled
                     * buffer.  Unfortunately, we have also seen this case occurring
                     * because of buggy Linux kernels that sometimes return an
                     * lseek(SEEK_END) result that doesn't account for a recent write. In
                     * that situation, the pre-existing buffer would contain valid data
                     * that we don't want to overwrite.  Since the legitimate case should
                     * always have left a zero-filled buffer, complain if not PageIsNew.
                     */
                    bufBlock = isLocalBuf ? LocalBufHdrGetBlock(bufHdr) : BufHdrGetBlock(bufHdr);
                    if (!PageIsNew((Page) bufBlock))
                            ereport(ERROR,
                             (errmsg("unexpected data beyond EOF in block %u of relation %s",
                                             blockNum, relpath(smgr->smgr_rnode, forkNum)),
                              errhint("This has been seen to occur with buggy kernels; consider updating your system.")));
    0 0
添加回答
+ 订阅

分享数据库前沿,解构实战干货,推动数据库技术变革

推荐文章
相似问题
推荐课程