Skip to content

Instantly share code, notes, and snippets.

@guilhermebkel
Last active January 9, 2020 10:09
Show Gist options
  • Save guilhermebkel/22f8b3cce07c72d3a7000d461f2b6e26 to your computer and use it in GitHub Desktop.
Save guilhermebkel/22f8b3cce07c72d3a7000d461f2b6e26 to your computer and use it in GitHub Desktop.
postgres-database-commands
echo "Command to make a dump of postgres database"
pg_dump -v -h DB_HOST -U DB_USER -d DB_NAME > DUMP_FILE.sql
echo "Command to restore a dump of postgres database"
psql -h DB_HOST -U DB_USER -W -d DB_NAME < DUMP_FILE.sql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment