Hackers,
I have been talking with Robert about table corruption that occurs from time to time. The page checksum feature seems
sufficientto detect most random corruption problems, but it can't detect "logical" corruption, where the page is valid
butinconsistent with the rest of the database cluster. This can happen due to faulty or ill-conceived backup and
restoretools, or bad storage, or user error, or bugs in the server itself. (Also, not everyone enables checksums.)
The attached module provides the means to scan a relation and sanity check it. Currently, it checks xmin and xmax
valuesagainst relfrozenxid and relminmxid, and also validates TOAST pointers. If people like this, it could be expanded
toperform additional checks.
There was a prior v1 patch, discussed offlist with Robert, not posted. Here is v2:
—
Mark Dilger
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company