Created
April 29, 2012 18:33
-
-
Save house9/2552493 to your computer and use it in GitHub Desktop.
Postgres Rebuild database
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
psql postgres -c "select pg_terminate_backend(procpid) from pg_stat_activity where datname='your_db';" | |
dropdb your_db | |
createdb --template=template0 --encoding=unicode your_db | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment