Created
June 17, 2015 18:47
-
-
Save sujaypillai/1950926a896ba5506bfc to your computer and use it in GitHub Desktop.
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
postgres=# SELECT | |
postgres-# pg_terminate_backend(pid) | |
postgres-# FROM | |
postgres-# pg_stat_activity | |
postgres-# WHERE | |
postgres-# -- don't kill my own connection! | |
postgres-# pid <> pg_backend_pid() | |
postgres-# -- don't kill the connections to other databases | |
postgres-# AND datname = 'alfresco' | |
postgres-# ; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://blog.sleeplessbeastie.eu/2014/07/23/how-to-terminate-postgresql-sessions/