错误:索引的缓存查找失败

时间:2016-05-04 14:16:28

标签: postgresql

在postgresql DB中运行以下错误

SELECT conname AS constraint_name
    , pg_catalog.pg_get_indexdef(d.objid) AS const_definition
    , CASE
      WHEN contype = 'p' THEN
                    'PRIMARY KEY'
                  ELSE
                    'UNIQUE'
                  END as constraint_type
FROM pg_catalog.pg_constraint AS c
JOIN pg_catalog.pg_depend AS d ON (d.refobjid = c.oid)
WHERE contype IN ('p', 'u')
AND deptype = 'i';

错误:索引28320的缓存查找失败

我如何解决这个问题以及出了什么问题?

错误是由

引起的
pg_catalog.pg_get_indexdef(d.objid) AS const_definition 

当我看到"生病的"索引

                constraint_name                 | objid | constraint_type
-------------------------------------------------+-------+-----------------
 pk_tbl_ruildossiers_fasen                       | 28318 | PRIMARY KEY
 pk_tbl_ruildossiers_fasen                       | 28320 | PRIMARY KEY
...

我看到2 pk同名。这可能是一个问题吗?

0 个答案:

没有答案