Postgresql Log cancel requests for ERROR: canceling statement due to user request

Viewed 1855

In the logs of our postgresql database we randomly see cancel requests like

ERROR: canceling statement due to user request

Is there a way to monitor/log the canceling request itself? Like APPLICATION_NAME, username, client address of the statement that triggered the cancellation/termination?

Best, Henry

1 Answers

A successful cancellation should only be able to come from the same app that is running the query being cancelled (or from a conspirator). So all that info for the request doing the cancellation should be either inapplicable, or the same as the info for the query being cancelled, which is already being logged if your log_line_prefix so dictates.

Related