Skip to content

Instantly share code, notes, and snippets.

@yorzi
Last active December 9, 2015 23:29
Show Gist options
  • Save yorzi/4344922 to your computer and use it in GitHub Desktop.
Save yorzi/4344922 to your computer and use it in GitHub Desktop.
dump / restore postgresql database.

To dump:

pg_dump dbname > dbname.sql

To restore:

cat dbname.sql | psql dbname

NOTICE:

You can use gzip to compress the file while doing scp transfer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment