Re: Subject: FATAL: cache lookup failed for relation 1247

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Israr Khan <israr(at)amnex(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Subject: FATAL: cache lookup failed for relation 1247
Date: 2023-10-11 14:24:34
Message-ID: 583765.1697034274@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Israr Khan <israr(at)amnex(dot)com> writes:
> I am facing the postgresql database access issue after doing vacuum on a
> table.

There has to have been more to it than that.

> Error : FATAL: cache lookup failed for relation 1247

1247 is pg_type, so this looks like rather nasty catalog corruption.
If you're really lucky, this might just be a messed-up index for
pg_class, but I'm afraid this might be something that calls for
professional data recovery help (if the data in that database is
valuable enough to you to justify that).

In any case, your first move should be to stop the postmaster and
make a physical backup (e.g. with tar) of the data directory.
Then at least you can get back to where you are if recovery
attempts make things worse.

After that, see if you can connect to that DB with system indexes
disabled, and if so try to issue REINDEX TABLE pg_class.

There's some other helpful info at

https://wiki.postgresql.org/wiki/Corruption

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Eugen Konkov 2023-10-11 14:52:13 Re: A question about possible recovery inconsistency
Previous Message Ron 2023-10-11 12:39:20 Re: No Data Being Inserted