Skip to content

Instantly share code, notes, and snippets.

@sirodoht
Last active August 30, 2019 22:43
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 sirodoht/d050c9905e9b9aecff0f1a3c990792d2 to your computer and use it in GitHub Desktop.
Save sirodoht/d050c9905e9b9aecff0f1a3c990792d2 to your computer and use it in GitHub Desktop.
How to dump and restore in Postgres using custom format

How to dump and restore in Postgres

Dump

$ pg_dump -h localhost -p 5432 -U dbuser -F c -b -v -f "./dump" dbname

Restore

$ pg_restore -h localhost -p 5432 -U dbuser -d dbname -v ./dump
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment