Skip to content

Instantly share code, notes, and snippets.

@vigneshblue
Created December 27, 2017 10:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vigneshblue/b5f602f424933c73155d5fc812741409 to your computer and use it in GitHub Desktop.
Save vigneshblue/b5f602f424933c73155d5fc812741409 to your computer and use it in GitHub Desktop.
pg_dump -F c -h localhost -U pg_user -d db_name | gzip -c > sql_dump.gz
#-F format c -> custom
#Restore
pg_restore -U username -d db_name -v dumpfile_location -h localhost
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment