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.


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.

  • Note that 9.3 introduced data checksums
    – user1822
    Mar 31, 2017 at 11:33

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.