Created
July 5, 2012 11:38
-
-
Save ffbit/3053222 to your computer and use it in GitHub Desktop.
PostgreSQL restore
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
#!/bin/bash | |
DB="dbname" | |
HOST="host" | |
UNAME="uname" | |
dropdb --host $HOST --port=5432 --username $UNAME $DB | |
createdb --host $HOST --port 5432 --username $UNAME --owner $UNAME $DB | |
gunzip -c $DB.backup.gz | psql --host $HOST --port 5432 --username $UNAME -d $DB |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment