Created
May 3, 2018 12:14
-
-
Save bernardoVale/19303727a42a80b2e1e4585f5b46b07c to your computer and use it in GitHub Desktop.
Drop Postgres DB
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Run this query | |
SELECT pg_terminate_backend(pg_stat_activity.pid) | |
FROM pg_stat_activity | |
WHERE pg_stat_activity.datname = 'target_db' | |
AND pid <> pg_backend_pid(); | |
DROP DATABASE target_db; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment