Skip to content

Instantly share code, notes, and snippets.

View InYourHead's full-sized avatar

Aleksander InYourHead

  • https://www.linkedin.com/in/aleksander-burzec-5943b4143/
  • Poland
  • 21:09 (UTC +02:00)
View GitHub Profile
@InYourHead
InYourHead / psql-with-gzip-cheatsheet.sh
Created April 13, 2021 08:04 — 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