Re: tuples gone?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Daniel Kalchev <daniel(at)digsys(dot)bg>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: tuples gone?
Date: 2002-05-23 14:09:56
Message-ID: 5203.1022162996@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Daniel Kalchev <daniel(at)digsys(dot)bg> writes:
> VACUUM tells me:

> NOTICE: Rel relx: TID 2344/5704: OID IS INVALID. TUPGONE 1.

It's physically impossible to get 2344 tuples on a page. (If you're
using 8k pages then the most you could have per page is less than 200.)
So the above TID is obviously bogus, implying that you have pages
with corrupted page headers --- probably pd_lower is much larger than
it should be.

You could try dumping out the contents of page 5704, eg

dd bs=8k skip=5704 count=1 <tablefile | od -x

just to see what's there, but I bet you will find that it looks like
it's been trashed.

> Is there any way to recover this relation? Or at least as much data as
> possible?

If you can figure out what pd_lower should be on each of the trashed
pages, you might be able to reset it to the correct value and recover
the tuples, if there are any un-trashed. Otherwise zero out the trashed
page(s). You should not expect to get everything back --- what you want
is to make the table readable so that you can dump the contents of the
undamaged pages.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Meskes 2002-05-23 14:20:22 Re: Redhat 7.3 time manipulation bug
Previous Message Tom Lane 2002-05-23 13:50:25 Re: Edge case problem with pg_dump