From: Tom Lane <tgl@sss.pgh.pa.us>
To: Zwettler Markus (OIZ) <Markus.Zwettler@zuerich.ch>
Cc: pgsql-generallists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: How to log pg_terminate_backend() calls
Date: Tue, 14 Jan 2020 08:44:41 -0500
Message-ID: <21030.1579009481@sss.pgh.pa.us> (raw)
In-Reply-To: <7065c63d01944768bcfae1182301217d@zuerich.ch>
References: <7065c63d01944768bcfae1182301217d@zuerich.ch>
"Zwettler Markus (OIZ)" <Markus.Zwettler@zuerich.ch> writes:
> We see some "FATAL: terminating connection due to administrator command" error messages in the Postgres logfile.
> We assume someone did pg_terminate_backend() calls.
> How can we log such calls, especially who did the call?
There's no built-in facility for that, short of log_statement = all.
You could try making a wrapper function: rename pg_terminate_backend
to something else and then make a plpgsql equivalent that issues
RAISE LOG and then calls the renamed function.
regards, tom lane
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: tgl@sss.pgh.pa.us, Markus.Zwettler@zuerich.ch
Subject: Re: How to log pg_terminate_backend() calls
In-Reply-To: <21030.1579009481@sss.pgh.pa.us>
References: <7065c63d01944768bcfae1182301217d@zuerich.ch> <21030.1579009481@sss.pgh.pa.us>
* 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