Re: need help for PostgreSQL consistency check mechanism - Mailing list pgsql-general

From Chen, Dongdong (GE Healthcare)
Subject Re: need help for PostgreSQL consistency check mechanism
Date
Msg-id 0332CB5EB6327940B291055AAD9642210430FB5F@SHAMLVEM02.e2k.ad.ge.com
Whole thread Raw
In response to Re: need help for PostgreSQL consistency check mechanism  (Alvaro Herrera <alvherre@commandprompt.com>)
Responses Re: need help for PostgreSQL consistency check mechanism
List pgsql-general
> 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

pgsql-general by date:

Previous
From: Martin Gainty
Date:
Subject: Re: Open source and diagramming survey
Next
From: Martijn van Oosterhout
Date:
Subject: Re: need help for PostgreSQL consistency check mechanism