Re: Detecting database corruption

From: Andrew Sullivan <ajs(at)crankycanuck(dot)ca>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Detecting database corruption
Date: 2004-01-19 18:59:48
Message-ID: 20040119185948.GB4457@phlogiston.dyndns.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Jan 13, 2004 at 06:06:03PM -0500, Jack Orenstein wrote:
> - Are any cases of corruption detected in the normal operation of
> PostgreSQL?

If this means, "Does the database usually check for corruption?" the
answer is, "Not as a matter of course." If this means, "Will I know
if the database is corrupt?" the answer is, "Probably." When
database corruption occurs, it's serious enough that things stop
working pretty fast. Note that this is an infrequent enough
occurrence that it's not part of the standard toolkit of DBAs; each
case tends to be unusual. It seems usually to be caused by faulty
hardware.

> - If there are, then how are applications notified when corruption
> is detected?

They get errors.

> - What symptoms should prompt us to suspect and check for corruption?

Refusal to start. Random crashes of the server. Strange errors
during tuple access, VACUUM operations, or pg_dump.

> - Are there any tools we can run to determine whether a database is
> corrupt?

This depends on the case. There is a utility called pgfsck floating
around; it's dangerous, and for use where things are really totally
hosed up so badly that you can't recover.

The real question is, what have you been using that makes database
corruption such a grave concern? If I had to worry that much about
Postgres database corruption, I'd use something else.

A

--
Andrew Sullivan | ajs(at)crankycanuck(dot)ca
Those who know history get to watch other people repeat it.
--Bruce Sterling

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Joshua D. Drake 2004-01-19 19:03:00 Re: New PostgreSQL search resource
Previous Message Tom Lane 2004-01-19 18:56:29 Re: Getting rid of duplicate tables.