Last Updated: February 25, 2016
·
417
· nicolaslazartekaqui

Postgres - How to dump a database

Dump a single database:

$ pg_dump -U username dbname -f dumpfile.sql

Dump all databases:

$ pg_dumpall -U username > dumpfile.sql