Created
August 30, 2015 06:49
-
-
Save prakashpp/e8d6ff95d1f26e5b3f97 to your computer and use it in GitHub Desktop.
Postgres all connections except one IP
This file contains 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
SELECT | |
pg_terminate_backend(pid) | |
FROM | |
pg_stat_activity | |
WHERE | |
client_addr <> '172.31.1.200' | |
AND datname = 'staging' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment