Fix corrupt pg_toast table?

From: Michael Clark <codingninja(at)gmail(dot)com>
To: pgsql-admin(at)postgresql(dot)org
Subject: Fix corrupt pg_toast table?
Date: 2009-07-30 21:48:08
Message-ID: bf5d83510907301448x33bd6d21rc63a00512b694f22@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hello everyone.
Sorry if this has been covered already, I haven't had any luck searching and
finding a solution.

I have a database which appears to have some corruption in a toast value.

When I select a certain table, I get the following error:
ERROR: invalid page header in block 984 of relation "pg_toast_17341_index"

I am new enough to PG that I am having some troubles navigating around the
system tables and being able to do anything useful.

This error seems to be preventing a vacuum, reindex, and PGCOPY from going
through on the database.

I wrote a little script to fetch this table row by row until I hit an error,
and I think this has narrowed it down to a specific row, although trying to
fetch a row beyond this also gave this error (I am hoping that is a side
effect of the problem and that not the rest of the table is lost).

What is the best course of action to try and fix this and recover the data?
I am not concerned with recovering the particular row that appears to be
having problems, but the rest of the data in the table is important.

Thanks a lot for any help on this,
Michael.

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Tom Lane 2009-07-30 21:59:08 Re: Fix corrupt pg_toast table?
Previous Message James Haworth 2009-07-30 11:04:05 Postgres has stopped listening on port 5432...