How To Install Pg_restore In Debian, Ubuntu, Alpine, Arch, Kali, CentOS, Fedora, Raspbian And MacOS?

How To Install Pg_restore In Debian, Ubuntu, Alpine, Arch, Kali, CentOS, Fedora, Raspbian And MacOS?

pg_restore

Restore a PostgreSQL database from an archive file created by pg_dump.

Install pg_restore

  • Debian apt-get install postgresql-client-9.1 Click to copy
  • Ubuntu apt-get install postgresql-client-9.3 Click to copy
  • Alpine OS apk add postgresql Click to copy
  • Arch Linux pacman -S postgresql-old-upgrade Click to copy
  • Kali Linux apt-get install postgresql-client-11 Click to copy
  • CentOS yum install postgresql Click to copy
  • Fedora dnf install postgresql Click to copy
  • Raspbian apt-get install postgresql-client-9.5 Click to copy
  • macOS brew install postgresql Click to copy

Restore a PostgreSQL database from an archive file created by pg_dump.

How to use pg_restore?

Below are few example commands for pg_restore that you can use in the terminal.

Restore an archive into an existing database:
pg_restore -d db_name archive_file.dumpClick to copy
Same as above, customize username:
pg_restore -U username -d db_name archive_file.dumpClick to copy
Same as above, customize host and port:
pg_restore -h host -p port -d db_name archive_file.dumpClick to copy
Clean database objects before creating them:
pg_restore --clean -d db_name archive_file.dumpClick to copy
Use multiple jobs to do the restoring:
pg_restore -j 2 -d db_name archive_file.dumpClick to copy
To install the latest version of pg_restore in your favorite operating system just copy the pg_restore installation command from above and paste it into terminal. It will download and install the latest version of pg_restore 2026 package in your OS.