SHARE
TWEET

Untitled

a guest Aug 18th, 2019 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SELECT a.datname,
  2.          l.relation::regclass,
  3.          l.transactionid,
  4.          l.mode,
  5.          l.GRANTED,
  6.          a.usename,
  7.          a.query,
  8.          a.query_start,
  9.          age(now(), a.query_start) AS "age",
  10.          a.pid
  11. FROM pg_stat_activity a
  12. JOIN pg_locks l ON l.pid = a.pid
  13. ORDER BY a.query_start;
  14.  
  15. SELECT t.schemaname,
  16.     t.relname,
  17.     l.locktype,
  18.     l.page,
  19.     l.virtualtransaction,
  20.     l.pid,
  21.     l.mode,
  22.     l.granted
  23.    FROM pg_locks l
  24.    JOIN pg_stat_all_tables t ON l.relation = t.relid
  25.   WHERE t.schemaname <> 'pg_toast'::name AND t.schemaname <> 'pg_catalog'::name
  26.   ORDER BY t.schemaname, t.relname;
  27.  
  28.  
  29.  SELECT pg_cancel_backend('1720');
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top