From: Tom Lane <tgl@sss.pgh.pa.us>
To: Jan Beseda <besedajohn@gmail.com>
Cc: pgsql-general@postgresql.org
Subject: Re: ERROR: XX000: cache lookup failed for type 75083631
Date: Thu, 14 Apr 2022 13:24:07 -0400
Message-ID: <1526268.1649957047@sss.pgh.pa.us> (raw)
In-Reply-To: <CAHaN6DaevgVJUn6Jne03gw15GZ2muP5vrsOqHsb382tbcqc3iw@mail.gmail.com>
References: <CAHaN6DaevgVJUn6Jne03gw15GZ2muP5vrsOqHsb382tbcqc3iw@mail.gmail.com>
Jan Beseda <besedajohn@gmail.com> writes:
> I'm having an issue with dropping a view as shown below:
> DROP VIEW access_group_view;
> ERROR: XX000: cache lookup failed for type 75083631
> LOCATION: format_type_internal, format_type.c:152
Does the behavior change if you say CASCADE?
The fact that it's failing in format_type() implies that something is
trying to print the name of a type, which doesn't seem like a main-line
activity for DROP VIEW. I am suspicious that pg_depend shows this type
OID as dependent for some reason on this view, and that the message
that it was trying to print was complaining about how that dependency
existed and that you'd need to say CASCADE to make it take. However,
since format_type() fails, the type OID must not really exist anymore,
implying that the pg_depend entry is orphaned.
That raises a different set of questions about how it got to be that way.
But at any rate, what I'd suggest is
1. Verify that the type OID is wrong:
select * from pg_type where oid = 75083631;
If that finds a row then we've got a whole other set of issues.
(BTW, if you want to be really sure, forcing a seqscan for this
query or reindexing pg_type could be advisable.)
2. Check for bogus entries in pg_depend:
select * from pg_depend where objid = 75083631;
select * from pg_depend where refobjid = 75083631;
3. If there's just one hit in pg_depend then it's probably
safe to delete that row.
regards, tom lane
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: tgl@sss.pgh.pa.us, besedajohn@gmail.com
Subject: Re: ERROR: XX000: cache lookup failed for type 75083631
In-Reply-To: <1526268.1649957047@sss.pgh.pa.us>
References: <CAHaN6DaevgVJUn6Jne03gw15GZ2muP5vrsOqHsb382tbcqc3iw@mail.gmail.com> <1526268.1649957047@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