Skip to content

Instantly share code, notes, and snippets.

@leetrout
Created November 1, 2011 18:57
Show Gist options
  • Save leetrout/1331532 to your computer and use it in GitHub Desktop.
Save leetrout/1331532 to your computer and use it in GitHub Desktop.
Reloading postgres databases with templates
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