Closed nunziotocci closed 5 years ago
it would be cool to call a database function when this happens, because then it would be a piece of cake to notify the sysadmin of the long running query via text or email.
Ok, I'll add a log_queries_over_action_name=<pg_function>
parameter and Envelope will pass the PID of the process to the function.
Envelope should keep track of what queries it's running and when they started so that if it takes a certain amount of time it issues a log.
This would be configurable by the config parameter
log_queries_over=<seconds>
. If set to zero, don't issue logs.Also, these logs should be issued no matter what the
log_level
is.It would be interesting if you could attach a custom action to this handler, but that would need to be discussed.