Skip to content

Instantly share code, notes, and snippets.

@suryatmodulus
Forked from kmatt/pv_dump.sh
Created January 27, 2023 10:36
Show Gist options
  • Select an option

  • Save suryatmodulus/e7dff45e9acb6db9960c3e4fd8d7b5c6 to your computer and use it in GitHub Desktop.

Select an option

Save suryatmodulus/e7dff45e9acb6db9960c3e4fd8d7b5c6 to your computer and use it in GitHub Desktop.
Monitoring dump and restore with pv
# dump
pg_dump testdb | pv -c -s $(psql -tc "SELECT pg_database_size('testdb')") -N dump | gzip > testdb.sql.gz
# restore
pv testdb_20120501.sql.gz | zcat | psql testdb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment