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'd like to run a check against databases in postgresql to verify that everything is ok after the server crash. On mysql it would be mysqlcheck. I would like to know the postgres equivalent.

share|improve this question

migrated from stackoverflow.com Jan 28 '13 at 6:27

This question came from our site for professional and enthusiast programmers.

2  
There is no need for this in Postgres. If no errors are reported during startup, everything is fine. –  a_horse_with_no_name Jan 28 '13 at 7:36

2 Answers 2

As of 9.2, there is no such tool, and probably wont be for some time. There have been efforts to put checksum per page but that has not happened yet due to what has been referred to as a set of "deadly traps." Until that happens, I doubt that such tools will even be feasible beyond some very basic cases. So the answer, I am afraid is that the infrastructure required to do this efficiently is not part of the system yet.

Assuming working hardware, drives that don't lie about write completion, sane settings, etc. it should be impossible for something like an unclean shutdown to cause corrution in PostgreSQL but I have seen it a few times (overheating machines, and the like). So I do agree with you about the need. It's just worth noting that it is not that easy to do.

share|improve this answer

The PostgreSQL 9.3 manual mentions check_postgres. Although, this tool appears to lack table integrity checks.

share|improve this answer

Your Answer

 
discard

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