Skip to content

Instantly share code, notes, and snippets.

@mattmc3
Created April 6, 2017 00:55
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 mattmc3/4e96bfc437393cca2a89f386f9aa08e1 to your computer and use it in GitHub Desktop.
Save mattmc3/4e96bfc437393cca2a89f386f9aa08e1 to your computer and use it in GitHub Desktop.
Postgres drop database
select pg_terminate_backend(pid) from pg_stat_activity where datname='$DB_NAME';
DROP DATABASE "$DB_NAME";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment