Skip to content

Instantly share code, notes, and snippets.

@atomkirk
Created May 16, 2013 02:08
Embed
What would you like to do?
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