Skip to content

Instantly share code, notes, and snippets.

@mauriballes
Created August 23, 2020 20:46
Show Gist options
  • Save mauriballes/8a83a9e16f286934a11e6720a04d9789 to your computer and use it in GitHub Desktop.
Save mauriballes/8a83a9e16f286934a11e6720a04d9789 to your computer and use it in GitHub Desktop.
Postgres Backup

Postgres Backup Commands

Backup

pg_dump -U postgres -W -O -x -c -h localhost postgres > script.sql

Restore

psql -U postgres -W -h localhost postgres < script.sql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment