Created
September 17, 2025 15:07
-
-
Save detj/3eb9d5931aff3b9628f1bad5ccd3515c to your computer and use it in GitHub Desktop.
Drop all Postgres connections
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
| -- Drop all connections except the one running this query | |
| SELECT pg_terminate_backend(pid) | |
| FROM pg_stat_activity | |
| WHERE datname = 'measure' | |
| AND pid <> pg_backend_pid(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment