Skip to content

Instantly share code, notes, and snippets.

@ArgonQQ
Created January 19, 2018 08:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ArgonQQ/a90d6c3dba9dc5041ab8f81aedbd68dd to your computer and use it in GitHub Desktop.
Save ArgonQQ/a90d6c3dba9dc5041ab8f81aedbd68dd to your computer and use it in GitHub Desktop.
Postgres Cheatsheet

Postgres Cheatsheet

Dump all PostgreSQL Databases

pg_dumpall | gzip -c > /path/to/backup/$(date +'%Y-%m-%d-%H-%M')-db.dump.gz

Reimport all PostgreSQL Databases

psql -f <pg_dump_file> postgres

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment