Daniel Lubarov

Viewing locks in Postgres

The basic version:

SELECT * FROM pg_locks;

A bit more useful:

SELECT pg_class.relname, pg_locks.mode, pg_locks.granted
    FROM pg_class, pg_locks
    WHERE pg_class.relfilenode = pg_locks.relation;