Skip to content

Instantly share code, notes, and snippets.

@sujaypillai
Created June 17, 2015 18:47
Show Gist options
  • Save sujaypillai/1950926a896ba5506bfc to your computer and use it in GitHub Desktop.
Save sujaypillai/1950926a896ba5506bfc to your computer and use it in GitHub Desktop.
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