Skip to content

Instantly share code, notes, and snippets.

@sirwolfgang
Created January 31, 2018 18:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sirwolfgang/cb35fcdad301aac2ad663f2155fdde6d to your computer and use it in GitHub Desktop.
Save sirwolfgang/cb35fcdad301aac2ad663f2155fdde6d to your computer and use it in GitHub Desktop.
Postgres
SELECT pg_terminate_backend(pg_stat_activity.pid)
FROM pg_stat_activity
WHERE datname = current_database()
AND pid <> pg_backend_pid();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment