LoginSignup
42
32

More than 5 years have passed since last update.

PostgreSQLの接続数について

Posted at

接続数の確認

SELECT * FROM pg_stat_activity;

同時接続数の設定値の確認

SHOW max_connections;

接続の開放

SELECT pg_terminate_backend(pid)
  FROM pg_stat_activity
 WHERE datname = 'DB名'
   AND pid <> pg_backend_pid();
42
32
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
42
32