pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Shoaib Mir <shoaibmir@gmail.com>
Cc: Darren Reed <darrenr+postgres@fastmail.net>
Cc: pgsql-admin@postgresql.org
Subject: Re: How to reindex when unable to open relation?
Date: Tue, 26 Feb 2008 01:54:09 -0500
Message-ID: <26104.1204008849@sss.pgh.pa.us> (raw)
In-Reply-To: <bf54be870802252233o5d7aa387o2c1eac2fcd2ae9fe@mail.gmail.com>
References: <47C3AE1F.2010804@fastmail.net>
	<bf54be870802252233o5d7aa387o2c1eac2fcd2ae9fe@mail.gmail.com>

"Shoaib Mir" <shoaibmir@gmail.com> writes:
> On Tue, Feb 26, 2008 at 5:13 PM, Darren Reed <darrenr+postgres@fastmail.net>
> wrote:
>> pg_dump: failed sanity check, parent table OID 16401 of pg_rewrite entry
>> OID 16403 not found
>> 
>> Is this recoverable without using a backup?

> Looks like to me corrupted system catalog!

Yah.

> I guess when you dropped the table it didn't delete the record from
> pg_rewrite was not deleted when the parent table was dropped. So you can try
> doing something:
> delete from pg_rewrite where oid = 16403;

That's not gonna help for these:

>> ERROR:  could not open relation with OID 16399
>> ERROR:  index "pg_attrdef_adrelid_adnum_index" contains unexpected zero 
>> page at block 1
>> ERROR:  could not open relation with OID 16389
>> ERROR:  could not open relation with OID 16393

I'm afraid Darren's DB has taken multiple mortal hits --- the evidence
here suggests that at least one pg_class page and at least one
pg_attrdef_adrelid_adnum_index page have been silently zeroed out by
*something*.  The index could be reconstituted by REINDEX, if its
underlying table is undamaged; but no amount of reindexing will bring
back missing table rows :-(

There's no info here to suggest exactly what went wrong; Darren, do you
want to fess up to any hardware problems, tripped-over power cords, or
such?  What PG version is this anyway?

			regards, tom lane



view thread (13+ messages)  latest in thread

Message-ID: <26104.1204008849@sss.pgh.pa.us>
Permalink:  ../26104.1204008849@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/26104.1204008849@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: tgl@sss.pgh.pa.us, shoaibmir@gmail.com, darrenr+postgres@fastmail.net
  Subject: Re: How to reindex when unable to open relation?
  In-Reply-To: <26104.1204008849@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox