Last active
March 3, 2025 14:08
-
-
Save andostronaut/a93b0e3f3eec4f19a358914413e08c94 to your computer and use it in GitHub Desktop.
Terminate PostgresSQL in Docker
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
docker exec -it container_name psql -U db_user -d postgres |
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
revoke connect on database target_db from public; | |
select pg_terminate_backend(pg_stat_activity.pid) | |
from pg_stat_activity | |
where pg_stat_activity.datname = 'target_db'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment