-- first
SELECT pg_terminate_backend(pg_stat_activity.pid)
FROM pg_stat_activity
WHERE pg_stat_activity.datname = 'DATABASE_NAME'
AND pid <> pg_backend_pid();
-- second
DROP DATABASE DATABASE_NAME;
Last active
November 13, 2020 17:09
-
-
Save microchipgnu/e445f69d0388bc988d1237c2d804005e to your computer and use it in GitHub Desktop.
postgres utils
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment