Skip to content

Instantly share code, notes, and snippets.

@tsolar
Created February 23, 2016 19:29
Show Gist options
  • Save tsolar/62954a438e0a4c00772d to your computer and use it in GitHub Desktop.
Save tsolar/62954a438e0a4c00772d to your computer and use it in GitHub Desktop.
dump & restore postgres db
#!/bin/bash
pg_dump -i -h <hostname> -p 5432 -U <user> -F c -b -v -f /tmp/<filename>.sql <database_name>
pg_restore -i -h <local_hostname> -p 5432 -U <user> -d <database_name> -v /tmp/<filename>.sql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment