Search PostgreSQL documentation
PG 18 · Browse by category, or enter a name or keyword
Popular entries9997
pg_resetwal --oldest-transaction-id=xidu xid--oldest-transaction-id=xid
Manually set the oldest unfrozen transaction ID. A safe value can be determined by looking for the numerically smallest file name in the directory pg_xact un…
pg_resetwal --pgdata=datadirdatadir-D datadir--pgdata=datadir
Specifies the location of the database directory. For safety reasons, you must specify the data directory on the command line. pg_resetwal does not use the …
pg_resetwal --versionV--version
Display version information, then exit.
pg_resetwal --wal-segsize=wal_segment_sizewal-segsize=wal_segment_size
Set the new WAL segment size, in megabytes. The value must be set to a power of 2 between 1 and 1024 (megabytes). See the same option of initdb for more informat…
pg_resetxlog renamed to pg_resetwalPostgreSQL 9.6 and below provided a command named pg_resetxlog to reset the write-ahead-log (WAL) files. This command was renamed to pg_resetwal, see pg_resetwal for documentation of pg_rese…
pg_restorerestore a PostgreSQL database from an archive file created by pg_dump
Synopsis pg_restore [connection-option...] [option...] [filename]
pg_restorerestore a PostgreSQL database from an archive file created by pg_dump
Synopsis pg_restore [connection-option...] [option...] [filename]
pg_restore --cleanc--clean
Before restoring database objects, issue commands to DROP all the objects that will be restored. This option is useful for overwriting an existing database. If any of the objects do…
pg_restore --createC--create
Create the database before restoring into it. If --clean is also specified, drop and recreate the target database before connecting to it. With --create, pg_restore also restores t…
pg_restore --data-onlya--data-only
Restore only the data, not the schema (data definitions) or statistics. Table data, large objects, and sequence values are restored, if present in the archive. This option is si…
pg_restore --dbname=dbnamed dbname--dbname=dbname
Connect to database dbname and restore directly into the database. The dbname can be a connection string. If so, connection string parameters will override any confli…
pg_restore --disable-triggersdisable-triggers
This option is relevant only when performing a restore without schema. It instructs pg_restore to execute commands to temporarily disable triggers on the target tables while…
pg_restore --enable-row-securityenable-row-security
This option is relevant only when restoring the contents of a table which has row security. By default, pg_restore will set row_security to off, to ensure that all data i…
pg_restore --exclude-schema=schemaN schema--exclude-schema=schema
Do not restore objects that are in the named schema. Multiple schemas to be excluded may be specified with multiple -N switches. When both -n and -N are given…
pg_restore --exit-on-errore--exit-on-error
Exit if an error is encountered while sending SQL commands to the database. The default is to continue and to display a count of errors at the end of the restoration.
pg_restore --file=filenamef filename--file=filename
Specify output file for generated script, or for the listing when used with -l. Use - for stdout.
pg_restore --filter=filenamefilter=filename
Specify a filename from which to read patterns for objects excluded or included from restore. The patterns are interpreted according to the same rules as -n/--schema for incl…
pg_restore --format=formatF format--format=format
Specify format of the archive. It is not necessary to specify the format, since pg_restore will determine the format automatically. If specified, it can be one of the…
pg_restore --function=function-name(argtype [, ...])P function-name(argtype [, ...])--function=function-name(argtype [, ...])
Restore the named function only. Be careful to spell the function name and arguments exactly as they appear in the d…
pg_restore --help?--help
Show help about pg_restore command line arguments, and exit.
pg_restore --host=hosth host--host=host
Specifies the host name of the machine on which the server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket. The default…
pg_restore --if-existsif-exists
Use DROP ... IF EXISTS commands to drop objects in --clean mode. This suppresses “does not exist” errors that might otherwise be reported. This option is not valid unless --clean i…
pg_restore --index=indexI index--index=index
Restore definition of named index only. Multiple indexes may be specified with multiple -I switches.
pg_restore --jobs=number-of-jobsj number-of-jobs--jobs=number-of-jobs
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…
pg_restore --listl--list
List the table of contents of the archive. The output of this operation can be used as input to the -L option. Note that if filtering switches such as -n or -t are used with -l, they…
pg_restore --no-aclx--no-privileges--no-acl
Prevent restoration of access privileges (grant/revoke commands).
pg_restore --no-commentsno-comments
Do not output commands to restore comments, even if the archive contains them.
pg_restore --no-datano-data
Do not output commands to restore data, even if the archive contains them.
pg_restore --no-data-for-failed-tablesno-data-for-failed-tables
By default, table data is restored even if the creation command for the table failed (e.g., because it already exists). With this option, data for such a table is s…
pg_restore --no-ownerO--no-owner
Do not output commands to set ownership of objects to match the original database. By default, pg_restore issues ALTER OWNER or SET SESSION AUTHORIZATION statements to set owners…
pg_restore --no-passwordw--no-password
Never issue a password prompt. If the server requires password authentication and a password is not available by other means such as a .pgpass file, the connection attempt wil…
pg_restore --no-policiesno-policies
Do not output commands to restore row security policies, even if the archive contains them.
pg_restore --no-publicationsno-publications
Do not output commands to restore publications, even if the archive contains them.
pg_restore --no-reconnectR--no-reconnect
This option is obsolete but still accepted for backwards compatibility.
pg_restore --no-schemano-schema
Do not output commands to restore schema (data definitions), even if the archive contains them.
pg_restore --no-security-labelsno-security-labels
Do not output commands to restore security labels, even if the archive contains them.
pg_restore --no-statisticsno-statistics
Do not output commands to restore statistics, even if the archive contains them.
pg_restore --no-subscriptionsno-subscriptions
Do not output commands to restore subscriptions, even if the archive contains them.
pg_restore --no-table-access-methodno-table-access-method
Do not output commands to select table access methods. With this option, all objects will be created with whichever table access method is the default during restore.
pg_restore --no-tablespacesno-tablespaces
Do not output commands to select tablespaces. With this option, all objects will be created in whichever tablespace is the default during restore.
More results
Find definitions in the PostgreSQL manuals, reference library, and extension catalogue.
Searching every version by default. Manual pages are indexed for PostgreSQL 10–20; the reference library and extension catalogue are not version-bound.
all: every version pg17: one version ex: extensions only ↑↓ select ↵ open