Re: Eren Başak 2018-03-20 
<cafntstpcstv8brqkg00a84v72b_ffnlinhu2c2top+qssmw...@mail.gmail.com>
> Another thing is that, in a similar manner, we could allow changing the
> error code which might be useful for extensions. For example, Citus could
> use it to cancel remote backends when it detects a distributed deadlock and
> changes the error code to something retryable while doing so.

Another useful thing to do on top of this patch would be to include
messages when the termination comes from postgres itself, e.g. on a
server shutdown. Possibly, the message for pg_terminate_backend() itself could
say that someone invoke that, unless overridden.

FATAL:  57P01: terminating connection due to administrator command: server 
shutting down
FATAL:  57P01: terminating connection due to administrator command: restarting 
because of a crash of another server process
FATAL:  57P01: terminating connection due to administrator command: terminated 
by pg_terminate_backend()

Christoph

Reply via email to