pg_dump -j 4 -Fd mydb -f mydb_dir

Category: Databases & SQL

pg_dump -j 4 -Fd mydb -f mydb_dir

Back up with four parallel dump jobs

Parallel dumping only works with directory format (-Fd), which writes one file per table into the mydb_dir folder. -j 4 runs four workers and can cut backup time dramatically on big databases. Restore with pg_restore -j 4 -d mydb mydb_dir.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.