Skip to content

Instantly share code, notes, and snippets.

@leeeandroo
Created March 15, 2018 11:12
Show Gist options
  • Save leeeandroo/cdc6988616b93f0274a7d7bb1819b741 to your computer and use it in GitHub Desktop.
Save leeeandroo/cdc6988616b93f0274a7d7bb1819b741 to your computer and use it in GitHub Desktop.
dump & restore psql
sudo su - postgres
pg_dump -Fc mydatabase > /tmp/mydatabase.sql
sudo su - postgres
pg_restore --verbose --clean -d mydatabase /tmp/mydatabase.sql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment