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 1rf1yb-00F0uc-23 for pgsql-bugs@arkaria.postgresql.org; Tue, 27 Feb 2024 18:14:49 +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 1rf1yZ-004qjI-3R for pgsql-bugs@arkaria.postgresql.org; Tue, 27 Feb 2024 18:14:47 +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 1rf1yY-004qj9-Rp for pgsql-bugs@lists.postgresql.org; Tue, 27 Feb 2024 18:14:47 +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 1rf1yW-001WjQ-K9 for pgsql-bugs@lists.postgresql.org; Tue, 27 Feb 2024 18:14:46 +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 41RIEhuC2135025; Tue, 27 Feb 2024 13:14:43 -0500 From: Tom Lane To: charles@twenty.com cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #18367: Cannot drop schema In-reply-to: <18367-8d35c5ecb617d821@postgresql.org> References: <18367-8d35c5ecb617d821@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Tue, 27 Feb 2024 16:11:29 +0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2135023.1709057683.1@sss.pgh.pa.us> Date: Tue, 27 Feb 2024 13:14:43 -0500 Message-ID: <2135024.1709057683@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk PG Bug reporting form writes: > When trying to drop a schema using DROP SCHEMA "brokenSchema"; > I'm facing the following error: > requested object address for unsupported object class 2: text result "" > The schema is empty from any table, type, trigger... That shouldn't happen :-(. I am guessing the cause is a corrupt entry in pg_depend. Class 2 is OCLASS_TYPE, so apparently some type got dropped but its pg_depend entry wasn't cleaned out, so DROP SCHEMA thinks there's still a dependent object. I would try to pg_dump the database, and if you can do that and reload successfully then discard the original. If you've found one bit of catalog corruption there's likely more. regards, tom lane