Skip to content

Instantly share code, notes, and snippets.

@atomkirk
Created May 16, 2013 02:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save atomkirk/5588917 to your computer and use it in GitHub Desktop.
Save atomkirk/5588917 to your computer and use it in GitHub Desktop.
Duplicate a postgres DB

To create a copy of a database, first make sure the destination doesn't exist:

psql -c "DROP DATABASE firehose_development;"

Then:

psql -c "CREATE DATABASE firehose_development WITH TEMPLATE firehose_test;"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment