https://www.postgresql.org/docs/current/explicit-locking.html https://postgrespro.ru/docs/postgresql/current/explicit-locking https://pglocks.org/?pgcommand=VACUUM samples select ... for update; select ..., pg_blocking_pids(pid), ... from pg_stat_activity where backend_type = 'client backend'; pg_locks transactionid, granted pg_terminate_backend(pid) function