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.

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'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 Jan 28 '13 at 6:27

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

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

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


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