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 1uydCm-00AeWL-SU for pgsql-admin@arkaria.postgresql.org; Tue, 16 Sep 2025 21:27:16 +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 1uydCi-002bVq-KH for pgsql-admin@arkaria.postgresql.org; Tue, 16 Sep 2025 21:27:13 +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 1uydCi-002bVi-8Y for pgsql-admin@lists.postgresql.org; Tue, 16 Sep 2025 21:27:13 +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.96) (envelope-from ) id 1uydCe-001CAk-0w for pgsql-admin@lists.postgresql.org; Tue, 16 Sep 2025 21:27:12 +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 58GLR5rh1395877; Tue, 16 Sep 2025 17:27:05 -0400 From: Tom Lane To: Sam Stearns cc: Pgsql-admin , Henry Ashu , Julie Mather Subject: Re: dropuser error In-reply-to: References: Comments: In-reply-to Sam Stearns message dated "Tue, 16 Sep 2025 13:13:58 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1395875.1758058025.1@sss.pgh.pa.us> Date: Tue, 16 Sep 2025 17:27:05 -0400 Message-ID: <1395876.1758058025@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Sam Stearns writes: > I'm trying to drop a user but getting the following error: > dropuser: error: removal of role "dalec" failed: ERROR: role "dalec" > cannot be dropped because some objects depend on it > DETAIL: 262 objects in database csbtest If the display looks like that rather than itemizing the objects, it's because they are in a different database of the cluster. You need to connect to the "csbtest" database and then you can drop or reassign ownership of those objects. (The subtext here is that users/roles are shared across the whole cluster, but most object kinds are local to one database. You can't "see" the details of objects in a different database than the one you're connected to. DROP USER knows that there are some dependencies, but not much more.) regards, tom lane