Re: Corrupted Data?

From: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
To: "Matthew T(dot) O'Connor" <matthew(at)zeut(dot)net>
Cc: Chester Kustarz <chester(at)arbor(dot)net>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Corrupted Data?
Date: 2004-09-14 13:52:49
Message-ID: 20040914135248.GA2785@dcc.uchile.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Sep 14, 2004 at 08:13:24AM -0400, Matthew T. O'Connor wrote:
> On Tue, 2004-09-14 at 00:46, Chester Kustarz wrote:
> > On Mon, 13 Sep 2004, Matthew T. O'Connor wrote:
> > > I backed up the entire data directory, and did a pg_resetxlog, but that
> > > didn't help. I found the specific row that seems to be the problem, but
> > > I can't delete it.
> >
> > I have used TRUNCATE on the table in this situation to recover. Another
> > option might be to DROP the table. Or perhaps restore from backups.
>
> I would really prefer not to do that as pg_dump has apparently been
> failing for a while so I would lose a fair amount of data.

You can create a pg_clog file (the one it's complaining about) filled
with zeros, using
dd if=/dev/zero bs=1k count=8 of=/path/to/data/pg_clog/0E3D

and then you should be able to pg_dump the table (or at least find out
if there is another corrupted tuple.) Beware that the corrupted tuple
may be in there if it's supposed not to be, or it may not be if it's
supposed to be.

After you get your data back, I'd suggest running the usual hardware
checking tools, and restore from the backup.

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"Use it up, wear it out, make it do, or do without"

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Martijn van Oosterhout 2004-09-14 14:05:42 Re: Grant
Previous Message MaRCeLO PeReiRA 2004-09-14 13:47:13 Grant