Pg_restore restores a PostgreSQL database from the archive created by Pg_dump.
Usage:
Pg_restore [OPTION] ... [FILE]
General Options:
-D,--dbname=name connect to database NAME
-F,--file=filename output file name
-F,--format=c|d|t backup file format (should be automatic)
-L,--list Print summarized TOC of the archive
-V,--verbose verbose mode
--help Show this help and then exit
--version output version information, then exit
Options controlling the Restore:
-A,--data-only restore only the data, no schema
-C,--clean Clean (drop) database objects before recreating
-C,--create create the target database
-E,--exit-on-error exit On Error, default was to continue
-I,--index=name restore named index
-j,--jobs=num Use this many parallel jobs to restore
-L,--use-list=filename Use table of contents from the This file for
Selecting/ordering output
-N,--schema=name restore only objects in the This schema
-O,--no-owner skip restoration of object ownership
-P,--function=name (args)
Restore named function
-S,--schema-only restore only the schema, no data
-S,--superuser=name superuser user NAME to use for disabling triggers
-T,--table=name restore named table
-T,--trigger=name restore named Trigger
-X,--no-privileges skip restoration of access privileges (Grant/revoke)
-1,--single-transaction
Restore as a single transaction
--disable-triggers disable triggers during data-only restore
--no-data-for-failed-tables
Do not restore data of tables this could not be
Created
--no-security-labels do not restore security labels
--no-tablespaces do not restore tablespace assignments
--use-set-session-authorization
Use SET SESSION AUTHORIZATION commands instead of
ALTER OWNER commands to set ownership
Connection options:
-H,--host=hostname database server host or socket directory
-p,--port=port database server port number
-U,--username=name Connect as specified database user
-W,--no-password never prompt for password
-W,--password force password prompt (should happen automatically)
--role=rolename do SET role before restore
If No input file name is supplied and then standard input is used.
Report bugs to <[email Protected]>.
Additional reference: Https://xly3000.wordpress.com/2012/03/07/postgresql%E8%87%AA%E5%8A%A8%E5%A4%87%E4%BB%BDbackup%E4%B8%8E%E6 %81%a2%e5%a4%8drestore%e6%95%b0%e6%8d%ae%e5%ba%93%e5%9b%be%e8%a7%a3/
Pg_restore Database Recovery Instructions