Fix corrupt pg_toast table? - Mailing list pgsql-admin

From Michael Clark
Subject Fix corrupt pg_toast table?
Date
Msg-id bf5d83510907301448x33bd6d21rc63a00512b694f22@mail.gmail.com
Whole thread Raw
Responses Re: Fix corrupt pg_toast table?  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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.


pgsql-admin by date:

Previous
From: Deepak Bala
Date:
Subject: Re: General queries regarding backup
Next
From: Tom Lane
Date:
Subject: Re: Fix corrupt pg_toast table?