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>);
Each week, I share a technical trick that I learned
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>);