Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 4E6602E0068 for ; Wed, 27 Feb 2008 12:54:10 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 72054-10 for ; Wed, 27 Feb 2008 12:54:03 -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 703052E003D for ; Wed, 27 Feb 2008 12:54:04 -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 m1RGs0sT029645; Wed, 27 Feb 2008 11:54:00 -0500 (EST) To: Darren Reed cc: Shoaib Mir , pgsql-admin@postgresql.org Subject: Re: How to reindex when unable to open relation? In-reply-to: <47C50590.2000104@fastmail.net> References: <47C3AE1F.2010804@fastmail.net> <47C3E88B.8070803@fastmail.net> <2862.1204040458@sss.pgh.pa.us> <47C4F178.1050102@fastmail.net> <14002.1204089578@sss.pgh.pa.us> <47C4F353.4040304@fastmail.net> <14210.1204090477@sss.pgh.pa.us> <47C50590.2000104@fastmail.net> Comments: In-reply-to Darren Reed message dated "Tue, 26 Feb 2008 22:39:12 -0800" Date: Wed, 27 Feb 2008 11:54:00 -0500 Message-ID: <29644.1204131240@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200802/370 X-Sequence-Number: 28444 Darren Reed writes: > Tom Lane wrote: >> I'm curious though exactly where the failure is, because there's not >> much in RelationCacheInitializePhase2 that looks like it could crash, > #0 0x08298378 in RelationCacheInitializePhase2 () at relcache.c:2394 > 2394 LOAD_CRIT_INDEX(AttributeRelidNumIndexId); > (gdb) where > #0 0x08298378 in RelationCacheInitializePhase2 () at relcache.c:2394 > #1 0x082ac19c in InitPostgres (dbname=0x83ba450 "postgres", > username=0x83c1428 "postgres") at postinit.c:459 Hmph. AFAICS the only possible way it could dump core right there is if RelationBuildDesc returned NULL or a bogus pointer. And RelationBuildDesc does have a NULL return defined: if it couldn't find a pg_class row for the relation. (So we probably ought to add an explicit error test to LOAD_CRIT_INDEX --- surprising it hasn't been seen before.) Anyway it seems that the problem is you are missing the pg_class row for pg_attribute_relid_attnum_index. And possibly other stuff too; this crash is mighty early in initialization and only a couple of core tables have been touched yet. What I fear is that one or more whole pages of pg_class have been lost --- either zeroed out or corrupted in a way that heapscan doesn't notice. You might be able to learn something from pg_filedump if you're interested in pursuing this for forensic purposes, but I'm afraid the odds of getting anything back from this database are mighty low. regards, tom lane