Pivotal Knowledge Base

Follow

Querying a table fails with "index 'xx' contains unexpected zero page at block xxx"

Problem

Query a table and you are treated with the below error message.

For e.gs

Here the index "pg_statlastop_classid_objid_staactionname_index" is having issue being read.

ERROR:  index "pg_statlastop_classid_objid_staactionname_index" contains unexpected zero page at block 311
HINT:  Please REINDEX it.

Cause

The cause of the issue is due to bad index pages and its unable to read it.

Solution

Reindex the problematic index to overcome the issue.

    Reindex index <schema_name>.<index_name>;

so in the above example.

    Reindex index pg_catalog.pg_statlastop_classid_objid_staactionname_index;

Incases of indexes which are standalone please refer to this article which describes how to connect using backend mode and then perform the reindex.

Comments

Powered by Zendesk