Commands.app

pg_restore

Backup & Restore

Restore a PostgreSQL database from archive

Options & Flags
Available options for this command
-d

Database to restore into

-c

Clean (drop) objects before recreating

-j

Number of parallel jobs

--no-owner

Skip restoration of object ownership

-t

Restore specific table only

Examples
Common usage examples

Restore from custom format backup

pg_restore -d mydb backup.dump

Clean and restore database

pg_restore -c -d mydb backup.dump

Parallel restore with 4 jobs

pg_restore -j 4 -d mydb backup.dump

Restore only users table

pg_restore -t users -d mydb backup.dump
Notes
  • Only works with non-plain-text dumps
  • For plain SQL, use psql -f instead
Related Commands
You might also find these useful