Created
November 1, 2011 18:57
-
-
Save leetrout/1331532 to your computer and use it in GitHub Desktop.
Reloading postgres databases with templates
This file contains 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
http://www.postgresql.org/docs/8.1/static/manage-ag-templatedbs.html | |
Step 1. Create a template of the DB you want to reload often. | |
e.g. | |
$ createdb -T my_db_name db_template_name | |
Step 2. Drop db and recreate from template when you need to reload. | |
e.g. | |
$ dropdb my_db_name && createdb -T db_template_name my_db_name |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment