Skip to content

Instantly share code, notes, and snippets.

pg_dump -F c -h localhost -U pg_user -d db_name | gzip -c > sql_dump.gz
#-F format c -> custom
#Restore
pg_restore -U username -d db_name -v dumpfile_location -h localhost