Created
February 6, 2018 05:21
-
-
Save jagira/35b2ba3a071c862e8c85cdbd3bee8003 to your computer and use it in GitHub Desktop.
Commands to take backup and restore a PostgreSQL database
This file contains hidden or 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
# Take backup | |
pg_dump -F c -v DATABASE_NAME -f FILENAME.sql | |
# Restore from backup | |
pg_restore --verbose --clean --no-owner --no-acl --dbname DATABASE_NAME FILENAME.sql |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment