Skip to content

Instantly share code, notes, and snippets.

@raymzag
Created November 19, 2020 03:16
Show Gist options
  • Save raymzag/40925c4f0fe7638ba1f3b6a7a3e3ef0d to your computer and use it in GitHub Desktop.
Save raymzag/40925c4f0fe7638ba1f3b6a7a3e3ef0d to your computer and use it in GitHub Desktop.
useful psql commands
# pg_dump
pg_dump -h localhost -p 5432 -U postgres -d my_db -x -O -Fc > my_db.dump
# pg_restore
pg_restore -h localhost -p 5432 -U postgres -d my_db -x -O -c -j 4 my_db.dump
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment