Skip to content

Instantly share code, notes, and snippets.

View sukeerthiadiga's full-sized avatar

Sukeerthi Adiga sukeerthiadiga

View GitHub Profile
@sukeerthiadiga
sukeerthiadiga / psql-with-gzip-cheatsheet.sh
Created May 17, 2020 18:41 — forked from brock/psql-with-gzip-cheatsheet.sh
Exporting and Importing Postgres Databases using gzip
# This is just a cheat sheet:
# On production
sudo -u postgres pg_dump database | gzip -9 > database.sql.gz
# On local
scp -C production:~/database.sql.gz
dropdb database && createdb database
gunzip < database.sql.gz | psql database