Re: Bad records in table - Mailing list pgsql-general

From Tom Lane
Subject Re: Bad records in table
Date
Msg-id 18430.1025636407@sss.pgh.pa.us
Whole thread Raw
In response to Bad records in table  ("Peter Darley" <pdarley@kinesis-cem.com>)
Responses Re: Bad records in table
List pgsql-general
"Peter Darley" <pdarley@kinesis-cem.com> writes:
> I can identify the bad records with a simple perl script that reads all the
> records sequentially and lets me know which ones crash the back end.  Now
> that I know which ones they are, how can I get rid of them?

DELETE?

That might not work very well if the corruption is in toasted fields,
but you haven't given any details that would let us know (not even such
basic info as your PG version).

But before doing that I'd suggest eyeballing the bad data using a tool
such as pg_filedump (see http://sources.redhat.com/rhdb/tools.html).
Look at the "ctid" column of the bad tuples to see what part of the
file you need to dump (ctid is block number and item number).  The
pattern of the corruption might give some clue what happened.

            regards, tom lane



pgsql-general by date:

Previous
From: hyldgaard@hotmail.com (Thomas Hyldgaard)
Date:
Subject: Comparing PostgreSQL and Oracle stability
Next
From: grant
Date:
Subject: Re: namespaces and schemas