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

From Martijn van Oosterhout
Subject Re: need help for PostgreSQL consistency check mechanism
Date
Msg-id 20090427061859.GA4676@svana.org
Whole thread Raw
In response to Re: need help for PostgreSQL consistency check mechanism  ("Chen, Dongdong (GE Healthcare)" <DongdongChen@ge.com>)
List pgsql-general
On Mon, Apr 27, 2009 at 10:13:47AM +0800, Chen, Dongdong (GE
> Healthcare) wrote: 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.

PostgreSQL knows when it has been shutdown abnormally and will recover
to a consistant state (i.e. rollback all uncommitted transactions).
Whether this constitutes "database record loss" depends on your
application. I personally havn't managed to actually corrupt Postgres
enough to lose anything, but it happens.

Just make sure your disk cache is safe, otherwise all bets are off.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Please line up in a tree and maintain the heap invariant while
> boarding. Thank you for flying nlogn airlines.

Attachment

pgsql-general by date:

Previous
From: "Chen, Dongdong (GE Healthcare)"
Date:
Subject: Re: need help for PostgreSQL consistency check mechanism
Next
From: Sam Mason
Date:
Subject: Re: Open source and diagramming survey