Inspect postgresql ongoing queries and kill it

To check the ongoing query

SELECT pid, query FROM pg_stat_activity WHERE state = 'active';

And kill the one is blocked

select pg_terminate_backend(<pid>);

Leave a Reply

Your email address will not be published. Required fields are marked *