Created
June 9, 2015 23:53
-
-
Save rvillas/0fa6ed09eabdd3f275f6 to your computer and use it in GitHub Desktop.
pg connections cheat
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- postgresql | |
-- list all open connections | |
SELECT * FROM pg_stat_activity; | |
-- close all open connections | |
select pg_terminate_backend(pid) from pg_stat_activity where datname='bow_production'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment