I have setup streaming replication on Postgres 9.1.6 running on a debian server and it's going on fine.

When I try to run a query on the replica DB I get the error below:

ERROR:  index "tbl_cust_id_idx" contains unexpected zero page at block 0
HINT:  Please REINDEX it.

What might be causing this error?

The question is also posted in https://stackoverflow.com/questions/17865135/postgres-9-1-6-error-index-contains-unexpected-zero-page-at-block-0

  • Can you run any other queries: SELECT version() or SELECT now()?
    – Richard Huxton
    Jul 25, 2013 at 18:55
  • 1
    Do you get this error when you connect to the database? Can you connect at all? If yes, can you successfully issue queries? Otherwise, this doesn't look very good. What are your fsync-related settings on the replica? What do we know about the storage system there?
    – dezso
    Jul 25, 2013 at 20:33

1 Answer 1


I just ran into the same issue on Postgres 8.3.11. Although I could not identify the root cause, the fix was simple enough:

REINDEX INDEX tbl_cust_id_idx;

This page contains hints as to what may have caused the error, although they are vague:

An indicated table index was corrupted (may be a result of recent postgres or system failure, there was a lack of free space on the device, etc).

Ideally it would be helpful if there was something that could be put in place to proactively prevent or correct these errors. On the bright side, this is the first time we have ever seen this problem in several years and across hundreds of machines.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.