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 1u1ozV-008dL9-9o for pgsql-bugs@arkaria.postgresql.org; Mon, 07 Apr 2025 16:06:29 +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 1u1ozT-000gKV-J4 for pgsql-bugs@arkaria.postgresql.org; Mon, 07 Apr 2025 16:06:27 +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 1u1ozT-000gKM-BN for pgsql-bugs@lists.postgresql.org; Mon, 07 Apr 2025 16:06:27 +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 1u1ozQ-003V39-1l for pgsql-bugs@lists.postgresql.org; Mon, 07 Apr 2025 16:06:26 +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 537G6HXq3467677; Mon, 7 Apr 2025 12:06:17 -0400 From: Tom Lane To: "David G. Johnston" cc: "Ing. Marijo Kristo" , PostgreSQL Bug List Subject: =?UTF-8?Q?Re:_=C2=A0_Re:_Re:_Revoke_Connect_Privilege_from_Databa?= =?UTF-8?Q?se_not_working?= In-reply-to: References: Comments: In-reply-to "David G. Johnston" message dated "Mon, 07 Apr 2025 08:37:43 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3467675.1744041977.1@sss.pgh.pa.us> Date: Mon, 07 Apr 2025 12:06:17 -0400 Message-ID: <3467676.1744041977@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 master, confirmed that after this command the privilege: > test_user=c/test_admin (on database testdb) still exists. That seems like > a bug. Its at least a POLA violation and I cannot figure out how to read > the revoke reference page in a way that explains it. I believe what's going on there is explained by the rule that "grants and revokes done by a superuser are done as if issued by the object owner". So here, what would be revoked is test_user=c/postgres, which isn't the privilege at issue. Include GRANTED BY in the REVOKE to override the default choice of grantor. IIRC, said rule was invented before we had the GRANTED BY syntax. It probably doesn't make as much sense today, but I'd be very afraid of breaking peoples' work flows by changing it. regards, tom lane