Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

share|improve this question
Can you run any other queries: SELECT version() or SELECT now()? – Richard Huxton Jul 25 '13 at 18:55
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 '13 at 20:33
Try reindex the index "tbl_cust_id_idx" . May be it will do. – francs Jul 26 '13 at 2:51

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.

share|improve this answer
Do you plan to upgrade to something younger? There are five newer major versions since 8.3 (which does not get any security or other updates since quite a while). – dezso Jul 2 '15 at 14:30
@dezso - I agree, but there are other reasons why the version is so old. But this issue does not seem to just be due to an older DB version... – Justin Ethier Jul 2 '15 at 14:40
No, not really - it's just a habit of quite a few contributors here to point this out. – dezso Jul 2 '15 at 15:07
Its not about the postgres version. we got this error in 9.4 too but still looking for the root cause of this. – Vinod Mar 29 at 11:13

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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