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.
migrated from stackoverflow.com Jan 28 at 6:27
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.