From: Julien Rouhaud <rjuju123@gmail.com>
To: milist ujang <ujang.milist@gmail.com>
Cc: pgsql-general@postgresql.org
Subject: Re: ERROR: catalog is missing 3 attribute(s) for relid 150243
Date: Fri, 19 Aug 2022 12:02:34 +0800
Message-ID: <20220819040234.ossib2ixphaolhz2@jrouhaud> (raw)
In-Reply-To: <CACG9ogxmH7rYX2_5ydZ3nHJeE+NYqyAPhdXs2WmP_g-Kj9bFFA@mail.gmail.com>
References: <CACG9ogy69xLrvm7zHqYBCDFLPqWgBKW0e3R3ry6Y9Z1ASOEzmA@mail.gmail.com>
<CACG9ogxmH7rYX2_5ydZ3nHJeE+NYqyAPhdXs2WmP_g-Kj9bFFA@mail.gmail.com>
Hi,
Please don't top-post on this list (and please trim quoted messages too).
On Fri, Aug 19, 2022 at 05:55:03AM +0700, milist ujang wrote:
> On Thu, Aug 18, 2022 at 5:33 PM milist ujang <ujang.milist@gmail.com> wrote:
> >
> > 3rd query ERROR same as subject (ERROR: catalog is missing 3 attribute(s)
> > for relid 150243)
>
> my version is 12.9 on x86_64.
>
> reading source code, got the message form RelationBuildTupleDesc() function:
>
> /*
> * end the scan and close the attribute relation
> */
> systable_endscan(pg_attribute_scan);
> table_close(pg_attribute_desc, AccessShareLock);
>
> if (need != 0)
> elog(ERROR, "pg_attribute catalog is missing %d attribute(s) for
> relation OID %u",
> need, RelationGetRelid(relation));
>
> I'm not sure whether this function will compare the mentioned relation
> attribute in pg_attribute and physical table (header) file?
No, this function is comparing pg_class.relnatts to rows fetched querying
pg_attribute for the given relation.
What it means is that you likely have data corruption. You could try to
reindex pg_attribute and see if that fixes that specific problems, but even if
it does you will have to investigate how data got corrupted, fix that root
problem, and then try to check for other corrupted data or restore from a sane
backup.
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: rjuju123@gmail.com, ujang.milist@gmail.com
Subject: Re: ERROR: catalog is missing 3 attribute(s) for relid 150243
In-Reply-To: <20220819040234.ossib2ixphaolhz2@jrouhaud>
References: <CACG9ogy69xLrvm7zHqYBCDFLPqWgBKW0e3R3ry6Y9Z1ASOEzmA@mail.gmail.com> <CACG9ogxmH7rYX2_5ydZ3nHJeE+NYqyAPhdXs2WmP_g-Kj9bFFA@mail.gmail.com> <20220819040234.ossib2ixphaolhz2@jrouhaud>
* 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