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 1tl93m-009eJ5-Uj for pgsql-general@arkaria.postgresql.org; Thu, 20 Feb 2025 16:05:58 +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 1tl93j-008ymY-VT for pgsql-general@arkaria.postgresql.org; Thu, 20 Feb 2025 16:05:56 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tl93j-008ymP-Kg for pgsql-general@lists.postgresql.org; Thu, 20 Feb 2025 16:05:55 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tl93h-001vNx-31 for pgsql-general@lists.postgresql.org; Thu, 20 Feb 2025 16:05:54 +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 51KG5osV2705564; Thu, 20 Feb 2025 11:05:50 -0500 From: Tom Lane To: "David G. Johnston" cc: Dominique Devienne , "pgsql-general@lists.postgresql.org" Subject: Re: DROP ROLE as SUPERUSER In-reply-to: References: Comments: In-reply-to "David G. Johnston" message dated "Thu, 20 Feb 2025 08:55:21 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <2705562.1740067550.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Thu, 20 Feb 2025 11:05:50 -0500 Message-ID: <2705563.1740067550@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk "David G. Johnston" writes: > On Thursday, February 20, 2025, Dominique Devienne > wrote: >> Hi. Today I was surprised that REVOKE ALL ON DATABASE FROM ROLE silently >> did nothing, even with CASCADE, when I was running it as SUPERUSER, >> preventing DROP'ing the ROLE. I had to manually SET ROLE to the GRANTOR, do >> the REVOKE, which DID something this time, and then I could DROP the role. > This has nothing to do with power/permissions. It is about not specifying > “granted by” in your SQL command and thus failing to fully and correctly > specify the single permission you want to revoke. It used to be that if a superuser issued GRANT/REVOKE, the operation was silently done as the owner of the affected object. That was always a bit of a wart, since among other things it meant that the object owner could undo it. Now you have to say "GRANTED BY " to get that effect. I'm not entirely sure, but I think this is closer to what the SQL standard says. regards, tom lane