Skip to content

Instantly share code, notes, and snippets.

@ksheurs
Created November 16, 2012 16:04
Show Gist options
  • Save ksheurs/4088503 to your computer and use it in GitHub Desktop.
Save ksheurs/4088503 to your computer and use it in GitHub Desktop.
Terminate postgres connections...
SELECT pg_terminate_backend(pid) FROM pg_stat_activity WHERE pid <> pg_backend_pid() AND datname = 'db_name';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment