Skip to content

Instantly share code, notes, and snippets.

@smailq
Created January 22, 2013 23:39
Show Gist options
  • Save smailq/4599943 to your computer and use it in GitHub Desktop.
Save smailq/4599943 to your computer and use it in GitHub Desktop.
Terminate existing connections to postgresql.
SELECT pg_terminate_backend(pg_stat_activity.procpid) FROM pg_stat_activity WHERE datname = '';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment