How to log pg_terminate_backend() calls

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How to log pg_terminate_backend() calls

Zwettler Markus (OIZ)

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?

 

 

Reply | Threaded
Open this post in threaded view
|

Re: How to log pg_terminate_backend() calls

Tom Lane-2
"Zwettler Markus (OIZ)" <[hidden email]> 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