Skip to content

Instantly share code, notes, and snippets.

@khebbie
Created February 4, 2015 15:05
Show Gist options
  • Save khebbie/57f9d9a20da144a9cbd6 to your computer and use it in GitHub Desktop.
Save khebbie/57f9d9a20da144a9cbd6 to your computer and use it in GitHub Desktop.
SELECT
pg_terminate_backend(pid)
FROM
pg_stat_activity
WHERE
pid <> pg_backend_pid()
AND datname = 'database name';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment