Created
August 20, 2012 16:58
-
-
Save fabriciocolombo/3405794 to your computer and use it in GitHub Desktop.
PostgreSQL Backup/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
pg_dump.exe --host $host --port 5432 --username $userName --format plain --create --verbose --file $fileName $databaseName | |
To restore backup done with plain format | |
psql -a -h $host -p 5432 -U $user -d $database -f $fileName -o restore.log | |
To restore backup done with other format | |
pg_restore -h $host -U $user --verbose -d $databaseName -C $backupFileName [2> restore.log] | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment