> Row level: it would be very expensive to compute, store and keep up to date. And it doesn't protect you from
corruptionelsewhere in the block.
> Block level: there was some effort to implement it for 8.4, but it fell into some deadly traps.
Checksum is my primitive thought, is there table level checksum? Our objective is like this: If shutdown normally, OK.
Ifshutdown ABNORMALLY, then reboot the OS, check whether there is database records loss or damage, if NO, OK, start app
asusual; if YES, run restore app(currently pg_restore). All this should be done automatically without manual operating
andavoid restoring if data records are in good condition.
> I wrote some plpgsql code a month ago to scan a table and detoast all toastable attributes, reporting it when an
exceptionwas raised. It was a very effective way to detect corrupted toast entries, which is the most visible way in
whichdata is corrupted.
Could you share the code pls, if possible? Just for a referrence.
--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support
Thanks!
Chen Dongdong