Skip to content

Instantly share code, notes, and snippets.

@pop3xrj
Created September 11, 2009 00:56
Show Gist options
  • Save pop3xrj/184976 to your computer and use it in GitHub Desktop.
Save pop3xrj/184976 to your computer and use it in GitHub Desktop.
postgresql db backup and pump into bz2
pg_dump -Unrcrm -h 192.168.x.x --exclude-table=public.foo --exclude-table=public.bar dbname | bzip2 -c > ~/file.bz2
bzip2 -d db.sql.bz2 |psql test test
SELECT relname, reltuples, relpages * 8 / 1024 AS "MB" FROM pg_class ORDER BY relpages DESC;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment