Re: Getting Error On pg_dump - Mailing list pgsql-general

From Craig Ringer
Subject Re: Getting Error On pg_dump
Date
Msg-id 4EB9C5FA.101@ringerc.id.au
Whole thread Raw
In response to Getting Error On pg_dump  (Prashant Bharucha <prashantbharucha@yahoo.ca>)
List pgsql-general
On 11/09/2011 05:49 AM, Prashant Bharucha wrote:
> Hello All
>
> Could you please help me ,Getting error when I try to get backup of
> database
>
> pg_dump: SQL command failed
> pg_dump: Error message from server: ERROR: missing chunk number 0 for
> toast value 87303 in pg_toast_27342

It looks like you have a damaged table.

Shut your database down and make a copy of the entire data directory
(including pg_xlog, pg_clog, and everything else in that folder) to a
different location. Make that copy read-only.

Most corruption issues are hardware related. Check your hard disks, RAID
controller, etc. Check your file systems. Check your system logs for
disk errors. Make sure you are NOT running with "fsync=off" in the
postgresql configuration, because if you are and you EVER had a crash
that's why you have the corruption. Check your CPU temperatures and if
you can run a memory test.

As for recovery: You can use the zero_damaged_pages option on a **COPY**
of your database to attempt a dump. This is likely to produce a dump
with some data missing or damaged, but the dump will finish.

Alternately, you can track down which table that toast table is
associated with using the pg_catalog tables and have a look at the main
table, see if you can identify and DELETE or UPDATE the damaged row(s).

--
Craig Ringer

pgsql-general by date:

Previous
From: Prashant Bharucha
Date:
Subject: Getting Error On pg_dump
Next
From: Craig Ringer
Date:
Subject: Re: Postgres vs other Postgres based MPP implementations