Audience: Data Users
Content Summary: This page details how to terminate long-running or hanging SQL commands or queries.
Below is a SQL Query, which contains instructions to help terminate long-running SQL commands or queries.
Note: This query excludes START_REPLICATION SLOT %
.
Use the inner select to determine if you have hanging queries, and replace pg_cancel_backend
with pg_terminate_backend
if they do not actually cancel. You can also change the interval if needed.