> Row level: it would be very expensive to compute, store and keep up to date.  
> And it doesn't protect you from corruption elsewhere 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. If shutdown ABNORMALLY, then reboot the 
OS, check whether there is database records loss or damage, if NO, OK, start 
app as usual; if YES, run restore app(currently pg_restore). All this should be 
done automatically without manual operating and avoid 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 exception was raised.  It was a 
> very effective way to detect corrupted toast entries, which is the most 
> visible way in which data 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

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Reply via email to