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

Darren Reed <darrenr+postgres@fastmail.net> 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



view thread (13+ messages)

Message-ID: <29644.1204131240@sss.pgh.pa.us>
Permalink:  ../29644.1204131240@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/29644.1204131240@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, darrenr+postgres@fastmail.net, shoaibmir@gmail.com
  Subject: Re: How to reindex when unable to open relation?
  In-Reply-To: <29644.1204131240@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