Skip to content

Instantly share code, notes, and snippets.

View andrius-preimantas's full-sized avatar

Andrius Preimantas andrius-preimantas

View GitHub Profile
@andrius-preimantas
andrius-preimantas / psql-with-gzip-cheatsheet.sh
Last active February 22, 2021 07:28 — 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