Find blocking sessions in postgres
-- QUERY TO FIND BLOCKING SESSION DETAILS
postgresql configurationintermediate
by PostgreSQL
16 views
-- QUERY TO FIND BLOCKING SESSION DETAILS
123456
dbaclass#
select pid as blocked_pid, usename, pg_blocking_pids(pid) as "blocked_by(pid)",
query as blocked_query from pg_stat_activity where cardinality(pg_blocking_pids(pid)) > 0;
blocked_pid | usename | blocked_by(pid) |    blocked_query
-------------+----------+-------------+------------------------------
4206 | postgres | {3673}Â Â Â | alter table test drop query;Please to add comments
No comments yet. Be the first to comment!