pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Christophe Pettus <xof@thebuild.com>
To: Bryn Llewellyn <bryn@yugabyte.com>
Cc: pgsql-general list <pgsql-general@lists.postgresql.org>
Subject: Re: Is it possible to stop sessions killing eachother when they all authorize as the same role?
Date: Mon, 12 Sep 2022 17:04:41 -0700
Message-ID: <C85947EF-7A77-4AB7-8FB6-EEAF16551DBF@thebuild.com> (raw)
In-Reply-To: <10F360BB-3149-45E6-BFFE-10B9AE31F1A6@yugabyte.com>
References: <10F360BB-3149-45E6-BFFE-10B9AE31F1A6@yugabyte.com>



> On Sep 12, 2022, at 15:51, Bryn Llewellyn <bryn@yugabyte.com> 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, 
(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.




view thread (32+ messages)  latest in thread

Message-ID: <C85947EF-7A77-4AB7-8FB6-EEAF16551DBF@thebuild.com>
Permalink:  ../C85947EF-7A77-4AB7-8FB6-EEAF16551DBF@thebuild.com/
Also on:    postgresql.org/message-id/C85947EF-7A77-4AB7-8FB6-EEAF16551DBF@thebuild.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: xof@thebuild.com, bryn@yugabyte.com
  Subject: Re: Is it possible to stop sessions killing eachother when they all authorize as the same role?
  In-Reply-To: <C85947EF-7A77-4AB7-8FB6-EEAF16551DBF@thebuild.com>
  References: <10F360BB-3149-45E6-BFFE-10B9AE31F1A6@yugabyte.com> <C85947EF-7A77-4AB7-8FB6-EEAF16551DBF@thebuild.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox