
This option is ignored when emitting a script rather than connecting directly to a database server.Įach job is one process or one thread, depending on the operating system, and uses a separate connection to the server.

This option can dramatically reduce the time to restore a large database to a server running on a multiprocessor machine. Run the most time-consuming steps of pg_restore - those that load data, create indexes, or create constraints - concurrently, using up to number-of-jobs concurrent sessions. Multiple indexes may be specified with multiple -I switches.
#BEST WAY TOPOSTGRESQL MAC ARCHIVE#
The archive is in the custom format of pg_dump. If specified, it can be one of the following: It is not necessary to specify the format, since pg_restore will determine the format automatically. Specify output file for generated script, or for the listing when used with -l. The default is to continue and to display a count of errors at the end of the restoration. eĮxit if an error is encountered while sending SQL commands to the database. If so, connection string parameters will override any conflicting command line options.

d dbnameĬonnect to database dbname and restore directly into the database. All data is restored into the database name that appears in the archive. When this option is used, the database named with -d is used only to issue the initial DROP DATABASE and CREATE DATABASE commands. Access privileges for the database itself are also restored, unless -no-acl is specified. With -create, pg_restore also restores the database's comment if any, and any configuration variable settings that are specific to this database, that is, any ALTER DATABASE. If -clean is also specified, drop and recreate the target database before connecting to it. (Unless -if-exists is used, this might generate some harmless error messages, if any objects were not present in the destination database.) -CĬreate the database before restoring into it. cĬlean (drop) database objects before recreating them. This option is similar to, but for historical reasons not identical to, specifying -section=data. Table data, large objects, and sequence values are restored, if present in the archive.

Restore only the data, not the schema (data definitions). If not specified, the standard input is used. Specifies the location of the archive file (or directory, for a directory-format archive) to be restored. For instance, if the archive was made using the “ dump data as INSERT commands” option, pg_restore will not be able to load the data using COPY statements. Obviously, pg_restore cannot restore information that is not present in the archive file. Some of the options controlling the output are therefore analogous to pg_dump options. This script output is equivalent to the plain text output format of pg_dump. Otherwise, a script containing the SQL commands necessary to rebuild the database is created and written to a file or standard output. If a database name is specified, pg_restore connects to that database and restores archive contents directly into the database.
#BEST WAY TOPOSTGRESQL MAC PORTABLE#
The archive files are designed to be portable across architectures. The archive files also allow pg_restore to be selective about what is restored, or even to reorder the items prior to being restored. It will issue the commands necessary to reconstruct the database to the state it was in at the time it was saved. Pg_restore is a utility for restoring a PostgreSQL database from an archive created by pg_dump in one of the non-plain-text formats.
