Skip to content

.tip

· one of the small things

pg_dump with --format=custom, always

A plain SQL dump restores in one thread, in order, all or nothing. The custom format is compressed, restores in parallel, and lets you pick the tables you want.

pg_dump --format=custom --file=app.dump app
pg_restore --jobs=8 --dbname=app_copy app.dump
pg_restore --list app.dump | grep orders

The day you need to restore one table from last night's backup, that's the difference between two minutes and an afternoon.

postgresqloperations