To do this, find the Postgres process which is currently executing the query:
The procpid column displays the Operating System's process ID that can then be used to send the INT signal which will cause Postgres to roll the query back and move on to the next one:SELECT procpid, current_query, query_start
FROM pg_stat_activity;
If this happens regularly, you can also tell Postgres to kill any query which takes longer than a given number of milliseconds (say 1 hour) by using this setting:kill -INT procpid
statement_timeout = 3600000


1 comments:
Or written in a less confusing way:
statement_timeout = 1h
Post a Comment