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 1qhuWL-004fsq-96 for pgsql-admin@arkaria.postgresql.org; Sun, 17 Sep 2023 16:21:17 +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 1qhuWJ-00BRXx-UE for pgsql-admin@arkaria.postgresql.org; Sun, 17 Sep 2023 16:21:15 +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 1qhuWJ-00BRXl-Fe for pgsql-admin@lists.postgresql.org; Sun, 17 Sep 2023 16:21:15 +0000 Received: from mout-u-107.mailbox.org ([80.241.59.207]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qhuWG-005j7E-3O for pgsql-admin@lists.postgresql.org; Sun, 17 Sep 2023 16:21:14 +0000 Received: from smtp202.mailbox.org (smtp202.mailbox.org [IPv6:2001:67c:2050:b231:465::202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-u-107.mailbox.org (Postfix) with ESMTPS id 4RpY842wFVz9sRy; Sun, 17 Sep 2023 18:21:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ewie.name; s=MBO0001; t=1694967668; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=696aLWB5aQB3uXscSxurEjd6C5UuIeWFYu/ngAn+fe8=; b=lNxUvjFvqwaUCWmSP7Ryo6vSlxUXKnT2hx6FtiKYZtrhnfzVryqV2dl44WGaHHNEwqVOze pPkuueBaduj8vO7LOTVkvSqYOu9cXQ7oP0jjN6DId1YqIJMJXyryRFr5eKkdTsZ6t/PNXB E1mI56cKwaGWhVDb0SpCv5y23pq4Ept0AZa7IV2zW3aTc7csLEnrXfa1Sqfs5Z02ir+dpr IXLE7JIjm2AOtd/RK79MFmGsv/wLT2BauDBPyIr5Wf2j/I6rJKLw+KFec18IUMJFaRpq6t RoKZ/7Oeqds79aZP4lxOfkfeaR1rxU51Cb4rqKfKuyflztIPwWFVPHi90Sy9PQ== Date: Sun, 17 Sep 2023 18:21:07 +0200 (CEST) From: Erik Wienhold To: M Sarwar , "pgsql-admin@lists.postgresql.org" Message-ID: <438062627.116020.1694967667916@office.mailbox.org> In-Reply-To: References: Subject: Re: Unable to drop the user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Priority: 3 Importance: Normal X-Rspamd-Queue-Id: 4RpY842wFVz9sRy List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 17/09/2023 17:26 CEST M Sarwar wrote: > I am trying to drop a user. > > drop USER Dev_BaoP ; > > I am getting the below error message. > > ERROR: role "dev_baop" cannot be dropped because some objects depend on it > DETAIL: privileges for schema public > privileges for schema Bronx You need to revoke those privileges before dropping the role [1]. Use psql command \dn+ to show them. Or just use the combo of REASSIGN OWNED BY and DROP OWNED BY. See also this recent thread [2]. [1] https://www.postgresql.org/docs/current/role-removal.html [2] https://www.postgresql.org/message-id/CAGbX52H6XVMzZ96TcyArjOPw2KCUpQ6EC1Ch%3DyPAyUxsL1Qreg%40mail.gmail.com -- Erik