LoginSignup
1
1

More than 5 years have passed since last update.

postgres ロック状態確認 メモ

Posted at

postgresでalter tableできないので、ロックされてるんだろうと思いいつもロックを確認するコマンドは覚えられないのでメモ。
自分素人過ぎて(#^ω^)ピキピキ

SELECT l.pid, db.datname, c.relname, l.locktype, l.mode FROM pg_locks l LEFT JOIN pg_class c ON l.relation=c.relfilenode LEFT JOIN pg_database db ON l.database = db.oid ORDER BY l.pid;

プロセスさよなら

SELECT pg_cancel_backend(プロセス名);
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1