select pg_terminate_backend(pid) from pg_stat_activity where datname = [database name];
Created
May 14, 2014 01:13
-
-
Save baringji/7479d1d5d3d3a049d398 to your computer and use it in GitHub Desktop.
Disconnect database connections in PostgreSQL 9.2+.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment