Created
February 4, 2013 20:24
-
-
Save jakesorce/4709443 to your computer and use it in GitHub Desktop.
kill connections commands
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
drop_command = "select pg_terminate_backend(procpid) from pg_stat_activity where datname='canvas_development';" | |
drop_command_queue = "select pg_terminate_backend(procpid) from pg_stat_activity where datname='canvas_queue_development';" | |
system("sudo -u postgres psql -c \"#{drop_command}\"") | |
system("sudo -u postgres psql -c \"#{drop_command_queue}\"") | |
system("psql -U canvas -c 'drop database canvas_development;'") | |
system("psql -U canvas -c 'create database canvas_development;'") | |
create_pg_extension | |
system("psql -U canvas -c 'drop database canvas_queue_development;'") | |
system("psql -U canvas -c 'create database canvas_queue_development;'") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment