Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id BB8502E0050 for ; Tue, 26 Feb 2008 02:54:15 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 04368-06 for ; Tue, 26 Feb 2008 02:54:13 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 523E02E0040 for ; Tue, 26 Feb 2008 02:54:13 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id m1Q6s9X5026105; Tue, 26 Feb 2008 01:54:09 -0500 (EST) To: "Shoaib Mir" cc: "Darren Reed" , pgsql-admin@postgresql.org Subject: Re: How to reindex when unable to open relation? In-reply-to: References: <47C3AE1F.2010804@fastmail.net> Comments: In-reply-to "Shoaib Mir" message dated "Tue, 26 Feb 2008 17:33:07 +1100" Date: Tue, 26 Feb 2008 01:54:09 -0500 Message-ID: <26104.1204008849@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200802/336 X-Sequence-Number: 28410 "Shoaib Mir" writes: > On Tue, Feb 26, 2008 at 5:13 PM, Darren Reed > 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