pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Dan Hrabarchuk <dan@kwasar.biz>
Cc: pgsql-admin@postgresql.org <pgsql-admin@postgresql.org>
Subject: Re: [Fwd: Re: Question about pgfsck]
Date: Thu, 07 Oct 2004 12:55:55 -0400
Message-ID: <29736.1097168155@sss.pgh.pa.us> (raw)
In-Reply-To: <1097166324.6719.221.camel@dan.geotivity.net>
References: <1097166324.6719.221.camel@dan.geotivity.net>

Dan Hrabarchuk <dan@kwasar.biz> writes:
> Is there a FAQ or a HOWTO on recovering from database corruption? If
> not, then I am willing to write it. I will need help getting the
> document together because as much as I google, I come up empty handed.
> ...
> I want to have something that can be easily digested and doesn't require
> advanced knowledge of postgres.

I think this is an impossible goal.  The facts of the matter are that it
generally *isn't* easy to get out of a corrupt-data scenario, and it
certainly isn't something that can be reduced to a cookbook recipe that
a novice can follow.  If we had bugs with effects as predictable as
that, we would have found them and fixed them long ago.  I think every
corruption situation is unique and has to be approached as a fresh
problem.

Part of that feeling stems from the fact that you usually want to try
to identify *why* the corruption occurred, not just fix its immediate
effects, and that almost always requires examining the entrails at a
pretty low level of detail.  If you don't find out why it happened then
you have no confidence that it won't happen again.

Don't get me wrong --- I think a HOWTO on this is a fine idea.  I'm just
telling you that it's going to have to be a fairly detailed document
that is going to teach the reader quite a bit about postgres internals.

You can collect a lot of material for it by trawling the PG mailing list
archives for old threads in which people were having corruption
problems.  Aside from the obvious of "corruption", try looking for
threads mentioning REINDEX, pg_resetxlog, pg_filedump, locating tuples
by ctid, the zero_damaged_pages parameter, memtest86, and badblocks,
as those are the common tools for this sort of activity.

You can search the archives either directly at
http://archives.postgresql.org/ or via Oleg and Teodor's indexer
at http://www.pgsql.ru/db/pgsearch/.  I tend to use both as they
seem to have different searching behavior.  Google has a good indexer
but a rather incomplete set of PG list archives, so that's usually my
last choice...

			regards, tom lane



view thread (2+ messages)

Message-ID: <29736.1097168155@sss.pgh.pa.us>
Permalink:  ../29736.1097168155@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/29736.1097168155@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: tgl@sss.pgh.pa.us, dan@kwasar.biz
  Subject: Re: [Fwd: Re: Question about pgfsck]
  In-Reply-To: <29736.1097168155@sss.pgh.pa.us>
  References: <1097166324.6719.221.camel@dan.geotivity.net> <29736.1097168155@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox