Skip to content

Instantly share code, notes, and snippets.

@ctrl-shift
Created May 21, 2013 08:27
Show Gist options
  • Save ctrl-shift/5618320 to your computer and use it in GitHub Desktop.
Save ctrl-shift/5618320 to your computer and use it in GitHub Desktop.
postgres terminate all connections to db
select pg_terminate_backend(pid)
from pg_stat_activity
where datname = 'db name'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment