Re: ERROR: could not open relation with OID

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Susy Ham" <sham(at)ncircle(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: ERROR: could not open relation with OID
Date: 2007-08-23 04:21:00
Message-ID: 16719.1187842860@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Susy Ham" <sham(at)ncircle(dot)com> writes:
> We are trying to perform a 'reindex database' and it will fail at
> varying points with a message like:
> ERROR: could not open relation with OID 587495058
> or
> ERROR: could not open relation with OID 587603875

Ugh :-(

> When we queried pg_class we got no rows returned:
> select oid,* from pg_class where oid in (587603875, 587495058);

Indeed not, since the error message is complaining exactly that it
couldn't find any such pg_class row. What you need to be looking into
is where the reference to the OID came from. I'd try looking into
pg_index and maybe pg_depend to see if there are rows linking to these
OIDs.

Also, in a message of this sort you really oughta expand a bit on your
reasons for needing a 'reindex database' in the first place, and the
procedure you are using for it. If you are trying to recover from
system catalog corruption then there's a number of subtle tricks to use
--- the main one being to run the backend with -P (which means "don't
trust the system indexes").

While I'm asking for specifics: exactly which PG version is this?

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2007-08-23 04:29:03 Re: CPU load high
Previous Message Michael Glaesemann 2007-08-23 04:00:41 Re: %TYPE