Skip to content

Instantly share code, notes, and snippets.

@clodal
Last active August 24, 2018 02:41
Show Gist options
  • Save clodal/ac66644c696f34cd8cae623cfcc3aab7 to your computer and use it in GitHub Desktop.
Save clodal/ac66644c696f34cd8cae623cfcc3aab7 to your computer and use it in GitHub Desktop.
Postgres Commands

Postgres Dump & Restore Database

pg_dump -h <DB_HOSTNAME> -U <DB_USERNAME> -f dump.sql <DB_NAME>

pg_restore -d <DB_NAME> <DUMP_FILE>
// OR
psql -d <DB_NAME> -f <DUMP_FILE>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment