Skip to content

Instantly share code, notes, and snippets.

@jmunts
Last active July 27, 2018 01:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jmunts/86605499c83e04a2bdd36722bc1e5270 to your computer and use it in GitHub Desktop.
Save jmunts/86605499c83e04a2bdd36722bc1e5270 to your computer and use it in GitHub Desktop.
Restore a postgresql dump file

Dumping database

pg_dump -Fc --no-acl --no-owner -h <host> -U <db_username> <db_name> > <name>.dump

Restoring

dropdb <db_name>
createdb <db_name>
pg_restore --verbose --clean --no-acl --no-owner -U <username> -d <db_name> < <dump_file>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment