Skip to content

Instantly share code, notes, and snippets.

@house9
Created April 29, 2012 18:33
Show Gist options
  • Save house9/2552493 to your computer and use it in GitHub Desktop.
Save house9/2552493 to your computer and use it in GitHub Desktop.
Postgres Rebuild database
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