Options (7)
-d, --dbnamebooleanRestore an archive into an existing database
Example:
pg_restore {{[-d|--dbname]}} {{db_name}} {{archive_file.dump}}-U, --usernamebooleanSame as above, customize username
Example:
pg_restore {{[-U|--username]}} {{username}} {{[-d|--dbname]}} {{db_name}} {{archive_file.dump}}-h, --hostbooleanSame as above, customize host and port
Example:
pg_restore {{[-h|--host]}} {{host}} {{[-p|--port]}} {{port}} {{[-d|--dbname]}} {{db_name}} {{archive_file.dump}}-p, --portbooleanSame as above, customize host and port
Example:
pg_restore {{[-h|--host]}} {{host}} {{[-p|--port]}} {{port}} {{[-d|--dbname]}} {{db_name}} {{archive_file.dump}}-l, --listbooleanList database objects included in the archive
Example:
pg_restore {{[-l|--list]}} {{archive_file.dump}}-c, --cleanbooleanClean database objects before creating them
Example:
pg_restore {{[-c|--clean]}} {{[-d|--dbname]}} {{db_name}} {{archive_file.dump}}-j, --jobsbooleanUse multiple jobs to do the restoring
Example:
pg_restore {{[-j|--jobs]}} {{2}} {{[-d|--dbname]}} {{db_name}} {{archive_file.dump}}Examples (6)
Restore an archive into an existing database
pg_restore [-d|--dbname] db_name archive_file.dumpSame as above, customize username
pg_restore [-U|--username] username [-d|--dbname] db_name archive_file.dumpSame as above, customize host and port
pg_restore [-h|--host] host [-p|--port] port [-d|--dbname] db_name archive_file.dumpList database objects included in the archive
pg_restore [-l|--list] archive_file.dumpClean database objects before creating them
pg_restore [-c|--clean] [-d|--dbname] db_name archive_file.dumpUse multiple jobs to do the restoring
pg_restore [-j|--jobs] 2 [-d|--dbname] db_name archive_file.dumpmade by @shridhargupta | data from tldr-pages