Skip to content

Instantly share code, notes, and snippets.

@kevn
Created September 9, 2010 19:18
Show Gist options
  • Save kevn/572375 to your computer and use it in GitHub Desktop.
Save kevn/572375 to your computer and use it in GitHub Desktop.
#!/usr/bin/env sh
# Kill connections
ps -u postgres|grep "postgres: postgres yam_development"|awk '{print $2}'|xargs sudo -u postgres kill -s SIGQUIT
ps -u postgres|grep "postgres: postgres yam_test" |awk '{print $2}'|xargs sudo -u postgres kill -s SIGQUIT
# Wait for db processes to stop
sleep 5
psql84 -Upostgres -c 'DROP DATABASE yam_development'
psql84 -Upostgres -c 'DROP DATABASE yam_test'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment