Започнете с проверка в системния изглед pg_locks. https://www.postgresql.org/docs/8.4 /interactive/view-pg-locks.html