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 1oXxrG-0007At-1Z for pgsql-general@arkaria.postgresql.org; Tue, 13 Sep 2022 04:49:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oXxrE-0006Rt-IL for pgsql-general@arkaria.postgresql.org; Tue, 13 Sep 2022 04:49:12 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oXxrE-0006R8-85 for pgsql-general@lists.postgresql.org; Tue, 13 Sep 2022 04:49:12 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oXxr7-0007oQ-KL for pgsql-general@lists.postgresql.org; Tue, 13 Sep 2022 04:49:11 +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 28D4n27t1883845; Tue, 13 Sep 2022 00:49:02 -0400 From: Tom Lane To: Bryn Llewellyn cc: "David G. Johnston" , pgsql-general list Subject: Re: Is it possible to stop sessions killing eachother when they all authorize as the same role? In-reply-to: References: <10F360BB-3149-45E6-BFFE-10B9AE31F1A6@yugabyte.com> <2F078227-5EEF-4553-89FF-046A6AF12F25@yugabyte.com> Comments: In-reply-to Bryn Llewellyn message dated "Mon, 12 Sep 2022 20:44:30 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <1883843.1663044542.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Tue, 13 Sep 2022 00:49:02 -0400 Message-ID: <1883844.1663044542@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Bryn Llewellyn writes: > My non-superuser normalrole with direct login, "u1", is *still* able to= invoke pg_terminate_backend() and kill other "u1" sessions=E2=80=94even a= fter this (as a super-user): Really? I did this in 14.5: regression=3D# revoke execute on function pg_terminate_backend from public= ; REVOKE regression=3D# select proacl from pg_proc where proname =3D 'pg_terminate_= backend'; proacl = ----------------------- {postgres=3DX/postgres} (1 row) (as expected, the superuser's own execute permission is all that remains) regression=3D# create user joe; CREATE ROLE regression=3D# \c - joe You are now connected to database "regression" as user "joe". regression=3D> select pg_terminate_backend(42); ERROR: permission denied for function pg_terminate_backend > It very much looks as if what I have describe was deemed to be a bug (af= ter that behavior had survived from at least version 11) and that it's now= been fixed! No, it very much looks like pilot error. But you've not shown us exactly what your test consisted of, so it's hard to say just where it went off the rails. regards, tom lane