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 1oXtQz-0003rj-Fz for pgsql-general@arkaria.postgresql.org; Tue, 13 Sep 2022 00:05:49 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oXtQy-0002ZI-CS for pgsql-general@arkaria.postgresql.org; Tue, 13 Sep 2022 00:05:48 +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 1oXtQy-0002Z9-2A for pgsql-general@lists.postgresql.org; Tue, 13 Sep 2022 00:05:48 +0000 Received: from smtp71.iad3a.emailsrvr.com ([173.203.187.71]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oXtQv-0005Vz-Vu for pgsql-general@lists.postgresql.org; Tue, 13 Sep 2022 00:05:47 +0000 X-Auth-ID: xof@thebuild.com Received: by smtp9.relay.iad3a.emailsrvr.com (Authenticated sender: xof-AT-thebuild.com) with ESMTPSA id 02AF8142A; Mon, 12 Sep 2022 20:05:43 -0400 (EDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.7\)) Subject: Re: Is it possible to stop sessions killing eachother when they all authorize as the same role? From: Christophe Pettus In-Reply-To: <10F360BB-3149-45E6-BFFE-10B9AE31F1A6@yugabyte.com> Date: Mon, 12 Sep 2022 17:04:41 -0700 Cc: pgsql-general list X-Mailbutler-Message-Id: 65280F81-FDB7-40EE-90A1-027B99B92969 Content-Transfer-Encoding: quoted-printable Message-Id: References: <10F360BB-3149-45E6-BFFE-10B9AE31F1A6@yugabyte.com> To: Bryn Llewellyn X-Mailer: Apple Mail (2.3608.120.23.2.7) X-Classification-ID: 57c1870b-fa0f-4f6c-851a-5cee1098f9e4-1-1 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On Sep 12, 2022, at 15:51, Bryn Llewellyn wrote: > The implication is that every client program must follow every = database call with defensive code to detect error "57P01" and = programmatically re-try. That situation exists even without the ability for a role to kill other = sessions authorized to the same role. A superuser (or role granted = pg_signal_backend) could have terminated it, the connection could have = broken due to a network failure (which caused the backend to roll back = and terminate), or the server could have crashed. Pragmatically, the only real additional risk cases here are: (a) An intrusion using that role,=20 (b) A client program that for some reason can issue a legitimate = pg_terminate_backend() call, but that has a bug that causes it to use it = inappropriately. In the case of (a), pg_terminate_backend() is the least of your worries, = and I have a hard time seeing (b) as a real-world risk that requires a = new PostgreSQL feature to defending again. Also pragmatically, it would be a *very* significant behavior shift if = roles could not by default signal other sessions authorized to the same = role, so it would be unwise to introduce that feature and have it be = revoked from non-superusers by default. And, if it's not revoked by = default, it's not going be very widely used except for ultra-locked-down = environments. I don't think it would hurt anything to introduce it, but = I'm not sure the utility is there.=