pg_restore Command Examples

Restore a PostgreSQL database from an archive file created by pg_dump. More information: https://www.postgresql.org/docs/current/app-pgrestore.html.

pg_restore -d {{db_name}} {{archive_file.dump}}

pg_restore -U {{username}} -d {{db_name}} {{archive_file.dump}}

pg_restore -h {{host}} -p {{port}} -d {{db_name}} {{archive_file.dump}}

pg_restore --list {{archive_file.dump}}

pg_restore --clean -d {{db_name}} {{archive_file.dump}}

pg_restore -j {{2}} -d {{db_name}} {{archive_file.dump}}