Take the 2-minute tour ×
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. It's 100% free, no registration required.

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 http://stackoverflow.com/questions/17865135/postgres-9-1-6-error-index-contains-unexpected-zero-page-at-block-0

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

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.

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 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 at 14:40
    
No, not really - it's just a habit of quite a few contributors here to point this out. –  dezso Jul 2 at 15:07

Your Answer

 
discard

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.