Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save armandfardeau/fc7332684e47ede7480ec4cdee9841f9 to your computer and use it in GitHub Desktop.
Save armandfardeau/fc7332684e47ede7480ec4cdee9841f9 to your computer and use it in GitHub Desktop.
How to drop all connections to a specific database without stopping the server?
select pg_terminate_backend(pid) from pg_stat_activity where datname='db';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment