Re: Bad records in table

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Peter Darley" <pdarley(at)kinesis-cem(dot)com>
Cc: "Pgsql-General" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Bad records in table
Date: 2002-07-02 19:00:07
Message-ID: 18430.1025636407@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Peter Darley" <pdarley(at)kinesis-cem(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message grant 2002-07-02 19:10:00 Re: namespaces and schemas
Previous Message Lev Lvovsky 2002-07-02 18:42:25 Re: triggers on date?