Skip to content

Instantly share code, notes, and snippets.

@house9
Created April 29, 2012 18:30
Show Gist options
  • Save house9/2552481 to your computer and use it in GitHub Desktop.
Save house9/2552481 to your computer and use it in GitHub Desktop.
Postgres Disconnect
# replace your_db with the name of your database
psql postgres -c "select pg_terminate_backend(procpid) from pg_stat_activity where datname='your_db';"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment