Postgresql create database owner12/25/2023 Restore only those archive elements that are listed in list-file, and restore them in the order they appear in the file. Note that if filtering switches such as -n or -t are used with -l, they will restrict the items listed. The output of this operation can be used as input to the -L option. List the table of contents of the archive. Also, multiple jobs cannot be used together with the option -single-transaction. The input must be a regular file or directory (not, for example, a pipe or standard input). Only the custom and directory archive formats are supported with this option. Of course, values that are too high will lead to decreased performance because of thrashing. A good place to start is the number of CPU cores on the server, but values larger than that can also lead to faster restore times in many cases. Factors include the number of CPU cores and the disk setup. The optimal value for this option depends on the hardware setup of the server, of the client, and of the network. 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. 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. CĬreate the database before restoring into it. If any of the objects do not exist in the destination database, ignorable error messages will be reported, unless -if-exists is also specified. This option is useful for overwriting an existing database. cīefore restoring database objects, issue commands to DROP all the objects that will be restored. 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. 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.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |