Skip to main content
Kill -9 Club
Sign in

pg_restore

DatabasesPackage: postgresql-clientHandle with care

Restores a pg_dump -Fc archive, wholly or in part (-t one table). -l lists the archive's contents without restoring anything; that is where to start.

A mistake with this command can destroy data or lock you out

  • pg_restore --clean drops objects before recreating them: on the wrong database, it erases production data. Restore into a fresh database, check, then switch.

What its options do in the lessons

From the same glossary the lessons render under their commands, so the two cannot disagree.

pg_restore --dbname
The database to restore into.

Lessons that teach it