Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qqa8l-0006mf-Ma for pgsql-general@arkaria.postgresql.org; Wed, 11 Oct 2023 14:24:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qqa8i-00GPJK-Eh for pgsql-general@arkaria.postgresql.org; Wed, 11 Oct 2023 14:24:45 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qqa8i-00GPJC-3V for pgsql-general@lists.postgresql.org; Wed, 11 Oct 2023 14:24:45 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qqa8a-0000ak-Lh for pgsql-general@postgresql.org; Wed, 11 Oct 2023 14:24:44 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 39BEOYdR583766; Wed, 11 Oct 2023 10:24:34 -0400 From: Tom Lane To: Israr Khan cc: pgsql-general@postgresql.org Subject: Re: Subject: FATAL: cache lookup failed for relation 1247 In-reply-to: References: Comments: In-reply-to Israr Khan message dated "Wed, 11 Oct 2023 11:35:59 +0530" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <583764.1697034274.1@sss.pgh.pa.us> Date: Wed, 11 Oct 2023 10:24:34 -0400 Message-ID: <583765.1697034274@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Israr Khan 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