Fill these in once
- Back up a database to a file
pg_dump -h localhost -U postgres -d myapp_dev -f myapp_dev.sql - Restore it into a new database
createdb -h localhost -U postgres myapp_dev_restored psql -h localhost -U postgres -d myapp_dev_restored -f myapp_dev.sql
Check it worked
- List the tables in the restored copy
psql -h localhost -U postgres -d myapp_dev_restored -c "\dt"
- Back up a database to a file
pg_dump -h localhost -U postgres -d myapp_dev -f myapp_dev.sql - Restore it into a new database
createdb -h localhost -U postgres myapp_dev_restored psql -h localhost -U postgres -d myapp_dev_restored -f myapp_dev.sql
Check it worked
- List the tables in the restored copy
psql -h localhost -U postgres -d myapp_dev_restored -c "\dt"
- Back up a database to a file
pg_dump -h localhost -U postgres -d myapp_dev -f myapp_dev.sql - Restore it into a new database
createdb -h localhost -U postgres myapp_dev_restored psql -h localhost -U postgres -d myapp_dev_restored -f myapp_dev.sql
Check it worked
- List the tables in the restored copy
psql -h localhost -U postgres -d myapp_dev_restored -c "\dt"