Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ovo7y-0008CG-BQ for pgsql-general@arkaria.postgresql.org; Thu, 17 Nov 2022 23:17:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ovo7x-0002xY-7o for pgsql-general@arkaria.postgresql.org; Thu, 17 Nov 2022 23:17:01 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ovo7w-0002wz-Ty for pgsql-general@lists.postgresql.org; Thu, 17 Nov 2022 23:17:00 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ovo7t-0003HK-SO for pgsql-general@lists.postgresql.org; Thu, 17 Nov 2022 23:16:59 +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 2AHNGuNc2058702; Thu, 17 Nov 2022 18:16:56 -0500 From: Tom Lane To: David Gauthier cc: pgsql-general@lists.postgresql.org Subject: Re: Drop role cascade ? In-reply-to: References: Comments: In-reply-to David Gauthier message dated "Thu, 17 Nov 2022 18:07:50 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2058700.1668727016.1@sss.pgh.pa.us> Date: Thu, 17 Nov 2022 18:16:56 -0500 Message-ID: <2058701.1668727016@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk David Gauthier writes: > Someone who had privileges in a lot of tables/schemas/DBs left the > company. I want to drop that role but "rop role xxx" won't let me > because... "xxx cannot be dropped because some objects depend on it". > Is there a way to just get rid of this role without revoking xxx in all > the individual DB objects he has privs too? Something like "drop role xxx > cascade" ? Not directly, but see REASSIGN OWNED and DROP OWNED. regards, tom lane