{"Entry":{"collection":"tool","key":"pg-dumpall","name":"pg_dumpall","aliases":["pg_dumpall"],"metadata":{"aliases":["pg_dumpall"],"category":"Client applications","content_hash":"82862a4657b3670d03315ff837489306acf50ddeec653ca599efef442a6126fb","imported_at":"2026-09-30T00:40:34.259687+08:00","name":"pg_dumpall","name_zh":"","slug":"pg-dumpall","summary":"pg_dumpall — extract a PostgreSQL database cluster into a script file"}},"Definition":{"Collection":"tool","Key":"pg-dumpall","SourceDatabase":"center","Version":"18","SourceTable":"command_tool","SourceKey":"pg-dumpall","SourceRevision":"ee8d1a3612338fd9adf250730cb640fcc5233b5491337cc00a316a44e3a0b9f8","Facts":{"comparison_data":{"environment":[{"description":"Default connection parameters","name":"PGHOST PGOPTIONS PGPORT PGUSER"},{"description":"Specifies whether to use color in diagnostic messages. Possible values are always , auto and never .","name":"PG_COLOR"}],"options":[{"description":"Dump only the data, not the schema (data definitions) or statistics.","names":["-a","--data-only"],"signature":"-a --data-only"},{"description":"Emit SQL commands to DROP all the dumped databases, roles, and tablespaces before recreating them. This option is useful when the restore is to overwrite an existing cluster. If any of the objects do not exist in the destination cluster, ignorable error messages will be reported during restore, unless --if-exists is also specified.","names":["-c","--clean"],"signature":"-c --clean"},{"description":"Create the dump in the specified character set encoding. By default, the dump is created in the database encoding. (Another way to get the same result is to set the PGCLIENTENCODING environment variable to the desired dump encoding.)","names":["-E encoding","--encoding= encoding"],"signature":"-E encoding --encoding= encoding"},{"description":"Send output to the specified file. If this is omitted, the standard output is used.","names":["-f filename","--file= filename"],"signature":"-f filename --file= filename"},{"description":"Dump only global objects (roles and tablespaces), no databases.","names":["-g","--globals-only"],"signature":"-g --globals-only"},{"description":"Do not output commands to set ownership of objects to match the original database. By default, pg_dumpall issues ALTER OWNER or SET SESSION AUTHORIZATION statements to set ownership of created schema elements. These statements will fail when the script is run unless it is started by a superuser (or the same user that owns all of the objects in the script). To make a script that can be restored by any user, but will give that user ownership of all the objects, specify -O .","names":["-O","--no-owner"],"signature":"-O --no-owner"},{"description":"Dump only roles, no databases or tablespaces.","names":["-r","--roles-only"],"signature":"-r --roles-only"},{"description":"Dump only the object definitions (schema), not data.","names":["-s","--schema-only"],"signature":"-s --schema-only"},{"description":"Specify the superuser user name to use when disabling triggers. This is relevant only if --disable-triggers is used. (Usually, it's better to leave this out, and instead start the resulting script as superuser.)","names":["-S username","--superuser= username"],"signature":"-S username --superuser= username"},{"description":"Dump only tablespaces, no databases or roles.","names":["-t","--tablespaces-only"],"signature":"-t --tablespaces-only"},{"description":"Specifies verbose mode. This will cause pg_dumpall to output start/stop times to the dump file, and progress messages to standard error. Repeating the option causes additional debug-level messages to appear on standard error. The option is also passed down to pg_dump .","names":["-v","--verbose"],"signature":"-v --verbose"},{"description":"Print the pg_dumpall version and exit.","names":["-V","--version"],"signature":"-V --version"},{"description":"Prevent dumping of access privileges (grant/revoke commands).","names":["-x","--no-privileges","--no-acl"],"signature":"-x --no-privileges --no-acl"},{"description":"This option is for use by in-place upgrade utilities. Its use for other purposes is not recommended or supported. The behavior of the option may change in future releases without notice.","names":["--binary-upgrade"],"signature":"--binary-upgrade"},{"description":"Dump data as INSERT commands with explicit column names ( INSERT INTO table ( column , ...) VALUES ... ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases.","names":["--column-inserts","--attribute-inserts"],"signature":"--column-inserts --attribute-inserts"},{"description":"This option disables the use of dollar quoting for function bodies, and forces them to be quoted using SQL standard string syntax.","names":["--disable-dollar-quoting"],"signature":"--disable-dollar-quoting"},{"description":"This option is relevant only when creating a dump with data and without schema. It instructs pg_dumpall to include commands to temporarily disable triggers on the target tables while the data is restored. Use this if you have referential integrity checks or other triggers on the tables that you do not want to invoke during data restore. Presently, the commands emitted for --disable-triggers must be done as superuser. So, you should also specify a superuser name with -S , or preferably be careful to start the resulting script as a superuser.","names":["--disable-triggers"],"signature":"--disable-triggers"},{"description":"Do not dump databases whose name matches pattern . Multiple patterns can be excluded by writing multiple --exclude-database switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple databases can also be excluded by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent shell wildcard expansion.","names":["--exclude-database= pattern"],"signature":"--exclude-database= pattern"},{"description":"Use the specified value of extra_float_digits when dumping floating-point data, instead of the maximum available precision. Routine dumps made for backup purposes should not use this option.","names":["--extra-float-digits= ndigits"],"signature":"--extra-float-digits= ndigits"},{"description":"Specify a filename from which to read patterns for databases excluded from the dump. The patterns are interpreted according to the same rules as --exclude-database . To read from STDIN , use - as the filename. The --filter option can be specified in conjunction with --exclude-database for excluding databases, and can also be specified more than once for multiple filter files. The file lists one database pattern per row, with the following format: exclude database PATTERN Lines starting with # are considered comments and ignored. Comments can be placed after an object pattern row as well. Blank lines are also ignored. See Patterns for how to perform quoting in patterns.","names":["--filter= filename"],"signature":"--filter= filename"},{"description":"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 is also specified.","names":["--if-exists"],"signature":"--if-exists"},{"description":"Dump data as INSERT commands (rather than COPY ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. Note that the restore might fail altogether if you have rearranged column order. The --column-inserts option is safer, though even slower.","names":["--inserts"],"signature":"--inserts"},{"description":"When dumping data for a table partition, make the COPY or INSERT statements target the root of the partitioning hierarchy that contains it, rather than the partition itself. This causes the appropriate partition to be re-determined for each row when the data is loaded. This may be useful when restoring data on a server where rows do not always fall into the same partitions as they did on the original server. That could happen, for example, if the partitioning column is of type text and the two systems have different definitions of the collation used to sort the partitioning column.","names":["--load-via-partition-root"],"signature":"--load-via-partition-root"},{"description":"Do not wait forever to acquire shared table locks at the beginning of the dump. Instead, fail if unable to lock a table within the specified timeout . The timeout may be specified in any of the formats accepted by SET statement_timeout .","names":["--lock-wait-timeout= timeout"],"signature":"--lock-wait-timeout= timeout"},{"description":"Do not dump COMMENT commands.","names":["--no-comments"],"signature":"--no-comments"},{"description":"Do not dump data.","names":["--no-data"],"signature":"--no-data"},{"description":"Do not dump row security policies.","names":["--no-policies"],"signature":"--no-policies"},{"description":"Do not dump publications.","names":["--no-publications"],"signature":"--no-publications"},{"description":"Do not dump passwords for roles. When restored, roles will have a null password, and password authentication will always fail until the password is set. Since password values aren't needed when this option is specified, the role information is read from the catalog view pg_roles instead of pg_authid . Therefore, this option also helps if access to pg_authid is restricted by some security policy.","names":["--no-role-passwords"],"signature":"--no-role-passwords"},{"description":"Do not dump schema (data definitions).","names":["--no-schema"],"signature":"--no-schema"},{"description":"Do not dump security labels.","names":["--no-security-labels"],"signature":"--no-security-labels"},{"description":"Do not dump statistics. This is the default.","names":["--no-statistics"],"signature":"--no-statistics"},{"description":"Do not dump subscriptions.","names":["--no-subscriptions"],"signature":"--no-subscriptions"},{"description":"By default, pg_dumpall will wait for all files to be written safely to disk. This option causes pg_dumpall to return without waiting, which is faster, but means that a subsequent operating system crash can leave the dump corrupt. Generally, this option is useful for testing but should not be used when dumping data from production installation.","names":["--no-sync"],"signature":"--no-sync"},{"description":"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.","names":["--no-table-access-method"],"signature":"--no-table-access-method"},{"description":"Do not output commands to create tablespaces nor select tablespaces for objects. With this option, all objects will be created in whichever tablespace is the default during restore.","names":["--no-tablespaces"],"signature":"--no-tablespaces"},{"description":"Do not output commands to set TOAST compression methods. With this option, all columns will be restored with the default compression setting.","names":["--no-toast-compression"],"signature":"--no-toast-compression"},{"description":"Do not dump the contents of unlogged tables. This option has no effect on whether or not the table definitions (schema) are dumped; it only suppresses dumping the table data.","names":["--no-unlogged-table-data"],"signature":"--no-unlogged-table-data"},{"description":"Add ON CONFLICT DO NOTHING to INSERT commands. This option is not valid unless --inserts or --column-inserts is also specified.","names":["--on-conflict-do-nothing"],"signature":"--on-conflict-do-nothing"},{"description":"Force quoting of all identifiers. This option is recommended when dumping a database from a server whose PostgreSQL major version is different from pg_dumpall 's, or when the output is intended to be loaded into a server of a different major version. By default, pg_dumpall quotes only identifiers that are reserved words in its own major version. This sometimes results in compatibility issues when dealing with servers of other versions that may have slightly different sets of reserved words. Using --quote-all-identifiers prevents such issues, at the price of a harder-to-read dump script.","names":["--quote-all-identifiers"],"signature":"--quote-all-identifiers"},{"description":"Use the provided string as the psql \\restrict key in the dump output. If no restrict key is specified, pg_dumpall will generate a random one as needed. Keys may contain only alphanumeric characters. This option is primarily intended for testing purposes and other scenarios that require repeatable output (e.g., comparing dump files). It is not recommended for general use, as a malicious server with advance knowledge of the key may be able to inject arbitrary code that will be executed on the machine that runs psql with the dump output.","names":["--restrict-key= restrict_key"],"signature":"--restrict-key= restrict_key"},{"description":"Dump data as INSERT commands (rather than COPY ). Controls the maximum number of rows per INSERT command. The value specified must be a number greater than zero. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents.","names":["--rows-per-insert= nrows"],"signature":"--rows-per-insert= nrows"},{"description":"Dump optimizer statistics.","names":["--statistics"],"signature":"--statistics"},{"description":"Dump only the statistics, not the schema (data definitions) or data. Optimizer statistics for tables, materialized views, foreign tables, and indexes are dumped.","names":["--statistics-only"],"signature":"--statistics-only"},{"description":"Include sequence data in the dump. This is the default behavior except when --no-data , --schema-only , or --statistics-only is specified.","names":["--sequence-data"],"signature":"--sequence-data"},{"description":"Output SQL-standard SET SESSION AUTHORIZATION commands instead of ALTER OWNER commands to determine object ownership. This makes the dump more standards compatible, but depending on the history of the objects in the dump, might not restore properly.","names":["--use-set-session-authorization"],"signature":"--use-set-session-authorization"},{"description":"Show help about pg_dumpall command line arguments, and exit.","names":["-?","--help"],"signature":"-? --help"},{"description":"Specifies parameters used to connect to the server, as a connection string ; these will override any conflicting command line options. The option is called --dbname for consistency with other client applications, but because pg_dumpall needs to connect to many databases, the database name in the connection string will be ignored. Use the -l option to specify the name of the database used for the initial connection, which will dump global objects and discover what other databases should be dumped.","names":["-d connstr","--dbname= connstr"],"signature":"-d connstr --dbname= connstr"},{"description":"Specifies the host name of the machine on which the database server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket. The default is taken from the PGHOST environment variable, if set, else a Unix domain socket connection is attempted.","names":["-h host","--host= host"],"signature":"-h host --host= host"},{"description":"Specifies the name of the database to connect to for dumping global objects and discovering what other databases should be dumped. If not specified, the postgres database will be used, and if that does not exist, template1 will be used.","names":["-l dbname","--database= dbname"],"signature":"-l dbname --database= dbname"},{"description":"Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections. Defaults to the PGPORT environment variable, if set, or a compiled-in default.","names":["-p port","--port= port"],"signature":"-p port --port= port"},{"description":"User name to connect as.","names":["-U username","--username= username"],"signature":"-U username --username= username"},{"description":"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 will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password.","names":["-w","--no-password"],"signature":"-w --no-password"},{"description":"Force pg_dumpall to prompt for a password before connecting to a database. This option is never essential, since pg_dumpall will automatically prompt for a password if the server demands password authentication. However, pg_dumpall will waste a connection attempt finding out that the server wants a password. In some cases it is worth typing -W to avoid the extra connection attempt. Note that the password prompt will occur again for each database to be dumped. Usually, it's better to set up a ~/.pgpass file than to rely on manual password entry.","names":["-W","--password"],"signature":"-W --password"},{"description":"Specifies a role name to be used to create the dump. This option causes pg_dumpall to issue a SET ROLE rolename command after connecting to the database. It is useful when the authenticated user (specified by -U ) lacks privileges needed by pg_dumpall , but can switch to a role with the required rights. Some installations have a policy against logging in directly as a superuser, and use of this option allows dumps to be made without violating the policy.","names":["--role= rolename"],"signature":"--role= rolename"}],"synopsis":["pg_dumpall [ connection-option ...] [ option ...]"]},"comparison_hash":"dd0edf9a9ef6de0e86b97b0a2b08127ecf99f382528014ef50f210767b2d4f6c","description":["pg_dumpall — extract a PostgreSQL database cluster into a script file"],"environment":[{"description":"Default connection parameters","name":"PGHOST PGOPTIONS PGPORT PGUSER"},{"description":"Specifies whether to use color in diagnostic messages. Possible values are always , auto and never .","name":"PG_COLOR"}],"facts":[{"label":"Documented executable","value":"pg_dumpall"},{"label":"Executable version","value":"18.6"},{"label":"Reference inventory","value":"Client applications"},{"label":"Option definition groups","value":"55"}],"manual_html":"\u003cdiv\u003e\u003cdiv class=\"refentry\" id=\"APP-PG-DUMPALL\"\u003e\n\u003cdiv class=\"titlepage\"\u003e\u003c/div\u003e\n\u003cdiv class=\"refnamediv\"\u003e\n\u003ch2\u003e\u003cspan class=\"refentrytitle\"\u003e\u003cspan class=\"application\"\u003epg_dumpall\u003c/span\u003e\u003c/span\u003e\u003c/h2\u003e\n\u003cp\u003epg_dumpall — extract a \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e database cluster into a script file\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsynopsisdiv\"\u003e\n\u003ch2\u003eSynopsis\u003c/h2\u003e\n\u003cdiv class=\"cmdsynopsis\"\u003e\n\u003cp id=\"id-1.9.4.15.4.1\"\u003e\u003ccode class=\"command\"\u003epg_dumpall\u003c/code\u003e [\u003cem class=\"replaceable\"\u003e\u003ccode\u003econnection-option\u003c/code\u003e\u003c/em\u003e...] [\u003cem class=\"replaceable\"\u003e\u003ccode\u003eoption\u003c/code\u003e\u003c/em\u003e...]\u003c/p\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"APP-PG-DUMPALL-DESCRIPTION\"\u003e\n\u003ch2\u003eDescription\u003c/h2\u003e\n\u003cp\u003e\u003cspan class=\"application\"\u003epg_dumpall\u003c/span\u003e is a utility for writing out (\u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003edumping\u003c/span\u003e”\u003c/span\u003e) all \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e databases of a cluster into one script file. The script file contains SQL commands that can be used as input to \u003ca class=\"xref\" href=\"/docs/18/app-psql.html\" title=\"psql\"\u003e\u003cspan class=\"refentrytitle\"\u003e\u003cspan class=\"application\"\u003epsql\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e to restore the databases. It does this by calling \u003ca class=\"xref\" href=\"/docs/18/app-pgdump.html\" title=\"pg_dump\"\u003e\u003cspan class=\"refentrytitle\"\u003e\u003cspan class=\"application\"\u003epg_dump\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e for each database in the cluster. \u003cspan class=\"application\"\u003epg_dumpall\u003c/span\u003e also dumps global objects that are common to all databases, namely database roles, tablespaces, and privilege grants for configuration parameters. (\u003cspan class=\"application\"\u003epg_dump\u003c/span\u003e does not save these objects.)\u003c/p\u003e\n\u003cp\u003eSince \u003cspan class=\"application\"\u003epg_dumpall\u003c/span\u003e reads tables from all databases you will most likely have to connect as a database superuser in order to produce a complete dump. Also you will need superuser privileges to execute the saved script in order to be allowed to add roles and create databases.\u003c/p\u003e\n\u003cp\u003eThe SQL script will be written to the standard output. Use the \u003ccode class=\"option\"\u003e-f\u003c/code\u003e/\u003ccode class=\"option\"\u003e--file\u003c/code\u003e option or shell operators to redirect it into a file.\u003c/p\u003e\n\u003cp\u003e\u003cspan class=\"application\"\u003epg_dumpall\u003c/span\u003e needs to connect several times to the \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e server (once per database). If you use password authentication it will ask for a password each time. It is convenient to have a \u003ccode class=\"filename\"\u003e~/.pgpass\u003c/code\u003e file in such cases. See \u003ca class=\"xref\" href=\"/docs/18/libpq-pgpass.html\" title=\"32.16. The Password File\"\u003eSection 32.16\u003c/a\u003e for more information.\u003c/p\u003e\n\u003cdiv class=\"warning\"\u003e\n\u003ch3 class=\"title\"\u003eWarning\u003c/h3\u003e\n\u003cp\u003eRestoring a dump causes the destination to execute arbitrary code of the source superusers' choice. Partial dumps and partial restores do not limit that. If the source superusers are not trusted, the dumped SQL statements must be inspected before restoring. Note that the client running the dump and restore need not trust the source or destination superusers.\u003c/p\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.4.15.6\"\u003e\n\u003ch2\u003eOptions\u003c/h2\u003e\n\u003cp\u003eThe following command-line options control the content and format of the output.\u003c/p\u003e\n\u003cdiv class=\"variablelist\"\u003e\n\u003cdl class=\"variablelist\"\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-a\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--data-only\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDump only the data, not the schema (data definitions) or statistics.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-c\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--clean\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eEmit SQL commands to \u003ccode class=\"command\"\u003eDROP\u003c/code\u003e all the dumped databases, roles, and tablespaces before recreating them. This option is useful when the restore is to overwrite an existing cluster. If any of the objects do not exist in the destination cluster, ignorable error messages will be reported during restore, unless \u003ccode class=\"option\"\u003e--if-exists\u003c/code\u003e is also specified.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-E \u003cem class=\"replaceable\"\u003e\u003ccode\u003eencoding\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--encoding=\u003cem class=\"replaceable\"\u003e\u003ccode\u003eencoding\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eCreate the dump in the specified character set encoding. By default, the dump is created in the database encoding. (Another way to get the same result is to set the \u003ccode class=\"envar\"\u003ePGCLIENTENCODING\u003c/code\u003e environment variable to the desired dump encoding.)\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-f \u003cem class=\"replaceable\"\u003e\u003ccode\u003efilename\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--file=\u003cem class=\"replaceable\"\u003e\u003ccode\u003efilename\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSend output to the specified file. If this is omitted, the standard output is used.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-g\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--globals-only\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDump only global objects (roles and tablespaces), no databases.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-O\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--no-owner\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDo not output commands to set ownership of objects to match the original database. By default, \u003cspan class=\"application\"\u003epg_dumpall\u003c/span\u003e issues \u003ccode class=\"command\"\u003eALTER OWNER\u003c/code\u003e or \u003ccode class=\"command\"\u003eSET SESSION AUTHORIZATION\u003c/code\u003e statements to set ownership of created schema elements. These statements will fail when the script is run unless it is started by a superuser (or the same user that owns all of the objects in the script). To make a script that can be restored by any user, but will give that user ownership of all the objects, specify \u003ccode class=\"option\"\u003e-O\u003c/code\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-r\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--roles-only\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDump only roles, no databases or tablespaces.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-s\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--schema-only\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDump only the object definitions (schema), not data.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-S \u003cem class=\"replaceable\"\u003e\u003ccode\u003eusername\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--superuser=\u003cem class=\"replaceable\"\u003e\u003ccode\u003eusername\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecify the superuser user name to use when disabling triggers. This is relevant only if \u003ccode class=\"option\"\u003e--disable-triggers\u003c/code\u003e is used. (Usually, it's better to leave this out, and instead start the resulting script as superuser.)\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-t\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--tablespaces-only\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDump only tablespaces, no databases or roles.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-v\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--verbose\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies verbose mode. This will cause \u003cspan class=\"application\"\u003epg_dumpall\u003c/span\u003e to output start/stop times to the dump file, and progress messages to standard error. Repeating the option causes additional debug-level messages to appear on standard error. The option is also passed down to \u003cspan class=\"application\"\u003epg_dump\u003c/span\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-V\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--version\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint the \u003cspan class=\"application\"\u003epg_dumpall\u003c/span\u003e version and exit.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-x\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--no-privileges\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--no-acl\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrevent dumping of access privileges (grant/revoke commands).\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--binary-upgrade\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eThis option is for use by in-place upgrade utilities. Its use for other purposes is not recommended or supported. The behavior of the option may change in future releases without notice.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--column-inserts\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--attribute-inserts\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDump data as \u003ccode class=\"command\"\u003eINSERT\u003c/code\u003e commands with explicit column names (\u003ccode class=\"literal\"\u003eINSERT INTO \u003cem class=\"replaceable\"\u003e\u003ccode\u003etable\u003c/code\u003e\u003c/em\u003e (\u003cem class=\"replaceable\"\u003e\u003ccode\u003ecolumn\u003c/code\u003e\u003c/em\u003e, ...) VALUES ...\u003c/code\u003e). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non-\u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e databases.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--disable-dollar-quoting\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eThis option disables the use of dollar quoting for function bodies, and forces them to be quoted using SQL standard string syntax.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--disable-triggers\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eThis option is relevant only when creating a dump with data and without schema. It instructs \u003cspan class=\"application\"\u003epg_dumpall\u003c/span\u003e to include commands to temporarily disable triggers on the target tables while the data is restored. Use this if you have referential integrity checks or other triggers on the tables that you do not want to invoke during data restore.\u003c/p\u003e\n\u003cp\u003ePresently, the commands emitted for \u003ccode class=\"option\"\u003e--disable-triggers\u003c/code\u003e must be done as superuser. So, you should also specify a superuser name with \u003ccode class=\"option\"\u003e-S\u003c/code\u003e, or preferably be careful to start the resulting script as a superuser.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--exclude-database=\u003cem class=\"replaceable\"\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDo not dump databases whose name matches \u003cem class=\"replaceable\"\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e. Multiple patterns can be excluded by writing multiple \u003ccode class=\"option\"\u003e--exclude-database\u003c/code\u003e switches. The \u003cem class=\"replaceable\"\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e parameter is interpreted as a pattern according to the same rules used by \u003cspan class=\"application\"\u003epsql\u003c/span\u003e's \u003ccode class=\"literal\"\u003e\\d\u003c/code\u003e commands (see \u003ca class=\"xref\" href=\"/docs/18/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"\u003ePatterns\u003c/a\u003e), so multiple databases can also be excluded by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent shell wildcard expansion.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--extra-float-digits=\u003cem class=\"replaceable\"\u003e\u003ccode\u003endigits\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eUse the specified value of extra_float_digits when dumping floating-point data, instead of the maximum available precision. Routine dumps made for backup purposes should not use this option.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--filter=\u003cem class=\"replaceable\"\u003e\u003ccode\u003efilename\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecify a filename from which to read patterns for databases excluded from the dump. The patterns are interpreted according to the same rules as \u003ccode class=\"option\"\u003e--exclude-database\u003c/code\u003e. To read from \u003ccode class=\"literal\"\u003eSTDIN\u003c/code\u003e, use \u003ccode class=\"filename\"\u003e-\u003c/code\u003e as the filename. The \u003ccode class=\"option\"\u003e--filter\u003c/code\u003e option can be specified in conjunction with \u003ccode class=\"option\"\u003e--exclude-database\u003c/code\u003e for excluding databases, and can also be specified more than once for multiple filter files.\u003c/p\u003e\n\u003cp\u003eThe file lists one database pattern per row, with the following format:\u003c/p\u003e\n\u003cpre class=\"synopsis\"\u003eexclude database \u003cem class=\"replaceable\"\u003e\u003ccode\u003ePATTERN\u003c/code\u003e\u003c/em\u003e\n\u003c/pre\u003e\n\u003cp\u003eLines starting with \u003ccode class=\"literal\"\u003e#\u003c/code\u003e are considered comments and ignored. Comments can be placed after an object pattern row as well. Blank lines are also ignored. See \u003ca class=\"xref\" href=\"/docs/18/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"\u003ePatterns\u003c/a\u003e for how to perform quoting in patterns.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--if-exists\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eUse \u003ccode class=\"literal\"\u003eDROP ... IF EXISTS\u003c/code\u003e commands to drop objects in \u003ccode class=\"option\"\u003e--clean\u003c/code\u003e mode. This suppresses \u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003edoes not exist\u003c/span\u003e”\u003c/span\u003e errors that might otherwise be reported. This option is not valid unless \u003ccode class=\"option\"\u003e--clean\u003c/code\u003e is also specified.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--inserts\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDump data as \u003ccode class=\"command\"\u003eINSERT\u003c/code\u003e commands (rather than \u003ccode class=\"command\"\u003eCOPY\u003c/code\u003e). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non-\u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e databases. Note that the restore might fail altogether if you have rearranged column order. The \u003ccode class=\"option\"\u003e--column-inserts\u003c/code\u003e option is safer, though even slower.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--load-via-partition-root\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eWhen dumping data for a table partition, make the \u003ccode class=\"command\"\u003eCOPY\u003c/code\u003e or \u003ccode class=\"command\"\u003eINSERT\u003c/code\u003e statements target the root of the partitioning hierarchy that contains it, rather than the partition itself. This causes the appropriate partition to be re-determined for each row when the data is loaded. This may be useful when restoring data on a server where rows do not always fall into the same partitions as they did on the original server. That could happen, for example, if the partitioning column is of type text and the two systems have different definitions of the collation used to sort the partitioning column.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--lock-wait-timeout=\u003cem class=\"replaceable\"\u003e\u003ccode\u003etimeout\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDo not wait forever to acquire shared table locks at the beginning of the dump. Instead, fail if unable to lock a table within the specified \u003cem class=\"replaceable\"\u003e\u003ccode\u003etimeout\u003c/code\u003e\u003c/em\u003e. The timeout may be specified in any of the formats accepted by \u003ccode class=\"command\"\u003eSET statement_timeout\u003c/code\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--no-comments\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDo not dump \u003ccode class=\"command\"\u003eCOMMENT\u003c/code\u003e commands.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--no-data\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDo not dump data.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--no-policies\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDo not dump row security policies.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--no-publications\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDo not dump publications.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--no-role-passwords\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDo not dump passwords for roles. When restored, roles will have a null password, and password authentication will always fail until the password is set. Since password values aren't needed when this option is specified, the role information is read from the catalog view \u003ccode class=\"structname\"\u003epg_roles\u003c/code\u003e instead of \u003ccode class=\"structname\"\u003epg_authid\u003c/code\u003e. Therefore, this option also helps if access to \u003ccode class=\"structname\"\u003epg_authid\u003c/code\u003e is restricted by some security policy.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--no-schema\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDo not dump schema (data definitions).\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--no-security-labels\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDo not dump security labels.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--no-statistics\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDo not dump statistics. This is the default.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--no-subscriptions\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDo not dump subscriptions.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--no-sync\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eBy default, \u003ccode class=\"command\"\u003epg_dumpall\u003c/code\u003e will wait for all files to be written safely to disk. This option causes \u003ccode class=\"command\"\u003epg_dumpall\u003c/code\u003e to return without waiting, which is faster, but means that a subsequent operating system crash can leave the dump corrupt. Generally, this option is useful for testing but should not be used when dumping data from production installation.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--no-table-access-method\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDo 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.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--no-tablespaces\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDo not output commands to create tablespaces nor select tablespaces for objects. With this option, all objects will be created in whichever tablespace is the default during restore.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--no-toast-compression\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDo not output commands to set TOAST compression methods. With this option, all columns will be restored with the default compression setting.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--no-unlogged-table-data\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDo not dump the contents of unlogged tables. This option has no effect on whether or not the table definitions (schema) are dumped; it only suppresses dumping the table data.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--on-conflict-do-nothing\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eAdd \u003ccode class=\"literal\"\u003eON CONFLICT DO NOTHING\u003c/code\u003e to \u003ccode class=\"command\"\u003eINSERT\u003c/code\u003e commands. This option is not valid unless \u003ccode class=\"option\"\u003e--inserts\u003c/code\u003e or \u003ccode class=\"option\"\u003e--column-inserts\u003c/code\u003e is also specified.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--quote-all-identifiers\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eForce quoting of all identifiers. This option is recommended when dumping a database from a server whose \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e major version is different from \u003cspan class=\"application\"\u003epg_dumpall\u003c/span\u003e's, or when the output is intended to be loaded into a server of a different major version. By default, \u003cspan class=\"application\"\u003epg_dumpall\u003c/span\u003e quotes only identifiers that are reserved words in its own major version. This sometimes results in compatibility issues when dealing with servers of other versions that may have slightly different sets of reserved words. Using \u003ccode class=\"option\"\u003e--quote-all-identifiers\u003c/code\u003e prevents such issues, at the price of a harder-to-read dump script.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--restrict-key=\u003cem class=\"replaceable\"\u003e\u003ccode\u003erestrict_key\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eUse the provided string as the \u003cspan class=\"application\"\u003epsql\u003c/span\u003e \u003ccode class=\"command\"\u003e\\restrict\u003c/code\u003e key in the dump output. If no restrict key is specified, \u003cspan class=\"application\"\u003epg_dumpall\u003c/span\u003e will generate a random one as needed. Keys may contain only alphanumeric characters.\u003c/p\u003e\n\u003cp\u003eThis option is primarily intended for testing purposes and other scenarios that require repeatable output (e.g., comparing dump files). It is not recommended for general use, as a malicious server with advance knowledge of the key may be able to inject arbitrary code that will be executed on the machine that runs \u003cspan class=\"application\"\u003epsql\u003c/span\u003e with the dump output.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--rows-per-insert=\u003cem class=\"replaceable\"\u003e\u003ccode\u003enrows\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDump data as \u003ccode class=\"command\"\u003eINSERT\u003c/code\u003e commands (rather than \u003ccode class=\"command\"\u003eCOPY\u003c/code\u003e). Controls the maximum number of rows per \u003ccode class=\"command\"\u003eINSERT\u003c/code\u003e command. The value specified must be a number greater than zero. Any error during restoring will cause only rows that are part of the problematic \u003ccode class=\"command\"\u003eINSERT\u003c/code\u003e to be lost, rather than the entire table contents.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--statistics\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDump optimizer statistics.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--statistics-only\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDump only the statistics, not the schema (data definitions) or data. Optimizer statistics for tables, materialized views, foreign tables, and indexes are dumped.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--sequence-data\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eInclude sequence data in the dump. This is the default behavior except when \u003ccode class=\"option\"\u003e--no-data\u003c/code\u003e, \u003ccode class=\"option\"\u003e--schema-only\u003c/code\u003e, or \u003ccode class=\"option\"\u003e--statistics-only\u003c/code\u003e is specified.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--use-set-session-authorization\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eOutput SQL-standard \u003ccode class=\"command\"\u003eSET SESSION AUTHORIZATION\u003c/code\u003e commands instead of \u003ccode class=\"command\"\u003eALTER OWNER\u003c/code\u003e commands to determine object ownership. This makes the dump more standards compatible, but depending on the history of the objects in the dump, might not restore properly.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-?\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--help\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eShow help about \u003cspan class=\"application\"\u003epg_dumpall\u003c/span\u003e command line arguments, and exit.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003cp\u003eThe following command-line options control the database connection parameters.\u003c/p\u003e\n\u003cdiv class=\"variablelist\"\u003e\n\u003cdl class=\"variablelist\"\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-d \u003cem class=\"replaceable\"\u003e\u003ccode\u003econnstr\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--dbname=\u003cem class=\"replaceable\"\u003e\u003ccode\u003econnstr\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies parameters used to connect to the server, as a \u003ca class=\"link\" href=\"/docs/18/libpq-connect.html#LIBPQ-CONNSTRING\" title=\"32.1.1. Connection Strings\"\u003econnection string\u003c/a\u003e; these will override any conflicting command line options.\u003c/p\u003e\n\u003cp\u003eThe option is called \u003ccode class=\"literal\"\u003e--dbname\u003c/code\u003e for consistency with other client applications, but because \u003cspan class=\"application\"\u003epg_dumpall\u003c/span\u003e needs to connect to many databases, the database name in the connection string will be ignored. Use the \u003ccode class=\"literal\"\u003e-l\u003c/code\u003e option to specify the name of the database used for the initial connection, which will dump global objects and discover what other databases should be dumped.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-h \u003cem class=\"replaceable\"\u003e\u003ccode\u003ehost\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--host=\u003cem class=\"replaceable\"\u003e\u003ccode\u003ehost\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies the host name of the machine on which the database server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket. The default is taken from the \u003ccode class=\"envar\"\u003ePGHOST\u003c/code\u003e environment variable, if set, else a Unix domain socket connection is attempted.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-l \u003cem class=\"replaceable\"\u003e\u003ccode\u003edbname\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--database=\u003cem class=\"replaceable\"\u003e\u003ccode\u003edbname\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies the name of the database to connect to for dumping global objects and discovering what other databases should be dumped. If not specified, the \u003ccode class=\"literal\"\u003epostgres\u003c/code\u003e database will be used, and if that does not exist, \u003ccode class=\"literal\"\u003etemplate1\u003c/code\u003e will be used.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-p \u003cem class=\"replaceable\"\u003e\u003ccode\u003eport\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--port=\u003cem class=\"replaceable\"\u003e\u003ccode\u003eport\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies the TCP port or local Unix domain socket file extension on which the server is listening for connections. Defaults to the \u003ccode class=\"envar\"\u003ePGPORT\u003c/code\u003e environment variable, if set, or a compiled-in default.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-U \u003cem class=\"replaceable\"\u003e\u003ccode\u003eusername\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--username=\u003cem class=\"replaceable\"\u003e\u003ccode\u003eusername\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eUser name to connect as.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-w\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--no-password\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eNever issue a password prompt. If the server requires password authentication and a password is not available by other means such as a \u003ccode class=\"filename\"\u003e.pgpass\u003c/code\u003e file, the connection attempt will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-W\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--password\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eForce \u003cspan class=\"application\"\u003epg_dumpall\u003c/span\u003e to prompt for a password before connecting to a database.\u003c/p\u003e\n\u003cp\u003eThis option is never essential, since \u003cspan class=\"application\"\u003epg_dumpall\u003c/span\u003e will automatically prompt for a password if the server demands password authentication. However, \u003cspan class=\"application\"\u003epg_dumpall\u003c/span\u003e will waste a connection attempt finding out that the server wants a password. In some cases it is worth typing \u003ccode class=\"option\"\u003e-W\u003c/code\u003e to avoid the extra connection attempt.\u003c/p\u003e\n\u003cp\u003eNote that the password prompt will occur again for each database to be dumped. Usually, it's better to set up a \u003ccode class=\"filename\"\u003e~/.pgpass\u003c/code\u003e file than to rely on manual password entry.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--role=\u003cem class=\"replaceable\"\u003e\u003ccode\u003erolename\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies a role name to be used to create the dump. This option causes \u003cspan class=\"application\"\u003epg_dumpall\u003c/span\u003e to issue a \u003ccode class=\"command\"\u003eSET ROLE\u003c/code\u003e \u003cem class=\"replaceable\"\u003e\u003ccode\u003erolename\u003c/code\u003e\u003c/em\u003e command after connecting to the database. It is useful when the authenticated user (specified by \u003ccode class=\"option\"\u003e-U\u003c/code\u003e) lacks privileges needed by \u003cspan class=\"application\"\u003epg_dumpall\u003c/span\u003e, but can switch to a role with the required rights. Some installations have a policy against logging in directly as a superuser, and use of this option allows dumps to be made without violating the policy.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.4.15.7\"\u003e\n\u003ch2\u003eEnvironment\u003c/h2\u003e\n\u003cdiv class=\"variablelist\"\u003e\n\u003cdl class=\"variablelist\"\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"envar\"\u003ePGHOST\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"envar\"\u003ePGOPTIONS\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"envar\"\u003ePGPORT\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"envar\"\u003ePGUSER\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDefault connection parameters\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"envar\"\u003ePG_COLOR\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies whether to use color in diagnostic messages. Possible values are \u003ccode class=\"literal\"\u003ealways\u003c/code\u003e, \u003ccode class=\"literal\"\u003eauto\u003c/code\u003e and \u003ccode class=\"literal\"\u003enever\u003c/code\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003cp\u003eThis utility, like most other \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e utilities, also uses the environment variables supported by \u003cspan class=\"application\"\u003elibpq\u003c/span\u003e (see \u003ca class=\"xref\" href=\"/docs/18/libpq-envars.html\" title=\"32.15. Environment Variables\"\u003eSection 32.15\u003c/a\u003e).\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.4.15.8\"\u003e\n\u003ch2\u003eNotes\u003c/h2\u003e\n\u003cp\u003eSince \u003cspan class=\"application\"\u003epg_dumpall\u003c/span\u003e calls \u003cspan class=\"application\"\u003epg_dump\u003c/span\u003e internally, some diagnostic messages will refer to \u003cspan class=\"application\"\u003epg_dump\u003c/span\u003e.\u003c/p\u003e\n\u003cp\u003eThe \u003ccode class=\"option\"\u003e--clean\u003c/code\u003e option can be useful even when your intention is to restore the dump script into a fresh cluster. Use of \u003ccode class=\"option\"\u003e--clean\u003c/code\u003e authorizes the script to drop and re-create the built-in \u003ccode class=\"literal\"\u003epostgres\u003c/code\u003e and \u003ccode class=\"literal\"\u003etemplate1\u003c/code\u003e databases, ensuring that those databases will retain the same properties (for instance, locale and encoding) that they had in the source cluster. Without the option, those databases will retain their existing database-level properties, as well as any pre-existing contents.\u003c/p\u003e\n\u003cp\u003eWhen \u003ccode class=\"option\"\u003e--statistics\u003c/code\u003e is specified, \u003ccode class=\"command\"\u003epg_dumpall\u003c/code\u003e will include most optimizer statistics in the resulting dump file. This does not include all statistics, such as those created explicitly with \u003ca class=\"xref\" href=\"/docs/18/sql-createstatistics.html\" title=\"CREATE STATISTICS\"\u003e\u003cspan class=\"refentrytitle\"\u003eCREATE STATISTICS\u003c/span\u003e\u003c/a\u003e, custom statistics added by an extension, or statistics collected by the cumulative statistics system. Therefore, it may still be useful to run \u003ccode class=\"command\"\u003eANALYZE\u003c/code\u003e on each database after restoring from a dump file to ensure optimal performance. You can also run \u003ccode class=\"command\"\u003evacuumdb -a -z\u003c/code\u003e to analyze all databases.\u003c/p\u003e\n\u003cp\u003eThe dump script should not be expected to run completely without errors. In particular, because the script will issue \u003ccode class=\"command\"\u003eCREATE ROLE\u003c/code\u003e for every role existing in the source cluster, it is certain to get a \u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003erole already exists\u003c/span\u003e”\u003c/span\u003e error for the bootstrap superuser, unless the destination cluster was initialized with a different bootstrap superuser name. This error is harmless and should be ignored. Use of the \u003ccode class=\"option\"\u003e--clean\u003c/code\u003e option is likely to produce additional harmless error messages about non-existent objects, although you can minimize those by adding \u003ccode class=\"option\"\u003e--if-exists\u003c/code\u003e.\u003c/p\u003e\n\u003cp\u003e\u003cspan class=\"application\"\u003epg_dumpall\u003c/span\u003e requires all needed tablespace directories to exist before the restore; otherwise, database creation will fail for databases in non-default locations.\u003c/p\u003e\n\u003cp\u003eIt is generally recommended to use the \u003ccode class=\"option\"\u003e-X\u003c/code\u003e (\u003ccode class=\"option\"\u003e--no-psqlrc\u003c/code\u003e) option when restoring a database from a \u003cspan class=\"application\"\u003epg_dumpall\u003c/span\u003e script to ensure a clean restore process and prevent potential conflicts with non-default \u003cspan class=\"application\"\u003epsql\u003c/span\u003e configurations. Additionally, because the \u003cspan class=\"application\"\u003epg_dumpall\u003c/span\u003e script may include \u003cspan class=\"application\"\u003epsql\u003c/span\u003e meta-commands, it may be incompatible with clients other than \u003cspan class=\"application\"\u003epsql\u003c/span\u003e.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"APP-PG-DUMPALL-EX\"\u003e\n\u003ch2\u003eExamples\u003c/h2\u003e\n\u003cp\u003eTo dump all databases:\u003c/p\u003e\n\u003cpre class=\"screen\"\u003e\u003ccode class=\"prompt\"\u003e$\u003c/code\u003e \u003cstrong class=\"userinput\"\u003e\u003ccode\u003epg_dumpall \u0026gt; db.out\u003c/code\u003e\u003c/strong\u003e\n\u003c/pre\u003e\n\u003cp\u003eTo restore database(s) from this file, you can use:\u003c/p\u003e\n\u003cpre class=\"screen\"\u003e\u003ccode class=\"prompt\"\u003e$\u003c/code\u003e \u003cstrong class=\"userinput\"\u003e\u003ccode\u003epsql -X -f db.out -d postgres\u003c/code\u003e\u003c/strong\u003e\n\u003c/pre\u003e\n\u003cp\u003eIt is not important which database you connect to here since the script file created by \u003cspan class=\"application\"\u003epg_dumpall\u003c/span\u003e will contain the appropriate commands to create and connect to the saved databases. An exception is that if you specified \u003ccode class=\"option\"\u003e--clean\u003c/code\u003e, you must connect to the \u003ccode class=\"literal\"\u003epostgres\u003c/code\u003e database initially; the script will attempt to drop other databases immediately, and that will fail for the database you are connected to.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.4.15.10\"\u003e\n\u003ch2\u003eSee Also\u003c/h2\u003e\n\u003cp\u003eCheck \u003ca class=\"xref\" href=\"/docs/18/app-pgdump.html\" title=\"pg_dump\"\u003e\u003cspan class=\"refentrytitle\"\u003e\u003cspan class=\"application\"\u003epg_dump\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e for details on possible error conditions.\u003c/p\u003e\n\u003c/div\u003e\n\u003c/div\u003e\u003c/div\u003e","manual_path":"app-pg-dumpall.html","options":[{"description":"Dump only the data, not the schema (data definitions) or statistics.","names":["-a","--data-only"],"signature":"-a --data-only","source_url":"/docs/18/app-pg-dumpall.html","summary":"Dump only the data, not the schema (data definitions) or statistics."},{"description":"Emit SQL commands to DROP all the dumped databases, roles, and tablespaces before recreating them. This option is useful when the restore is to overwrite an existing cluster. If any of the objects do not exist in the destination cluster, ignorable error messages will be reported during restore, unless --if-exists is also specified.","names":["-c","--clean"],"signature":"-c --clean","source_url":"/docs/18/app-pg-dumpall.html","summary":"Emit SQL commands to DROP all the dumped databases, roles, and tablespaces before recreating them. This option is useful when the restore is to overwrite an existing cluster. If any of the objects do not exist in the destination cluster, ignorable error messages will be reported during restore, unless --if-exists is also specified."},{"description":"Create the dump in the specified character set encoding. By default, the dump is created in the database encoding. (Another way to get the same result is to set the PGCLIENTENCODING environment variable to the desired dump encoding.)","names":["-E encoding","--encoding= encoding"],"signature":"-E encoding --encoding= encoding","source_url":"/docs/18/app-pg-dumpall.html","summary":"Create the dump in the specified character set encoding. By default, the dump is created in the database encoding. (Another way to get the same result is to set the PGCLIENTENCODING environment variable to the desired dump encoding.)"},{"description":"Send output to the specified file. If this is omitted, the standard output is used.","names":["-f filename","--file= filename"],"signature":"-f filename --file= filename","source_url":"/docs/18/app-pg-dumpall.html","summary":"Send output to the specified file. If this is omitted, the standard output is used."},{"description":"Dump only global objects (roles and tablespaces), no databases.","names":["-g","--globals-only"],"signature":"-g --globals-only","source_url":"/docs/18/app-pg-dumpall.html","summary":"Dump only global objects (roles and tablespaces), no databases."},{"description":"Do not output commands to set ownership of objects to match the original database. By default, pg_dumpall issues ALTER OWNER or SET SESSION AUTHORIZATION statements to set ownership of created schema elements. These statements will fail when the script is run unless it is started by a superuser (or the same user that owns all of the objects in the script). To make a script that can be restored by any user, but will give that user ownership of all the objects, specify -O .","names":["-O","--no-owner"],"signature":"-O --no-owner","source_url":"/docs/18/app-pg-dumpall.html","summary":"Do not output commands to set ownership of objects to match the original database. By default, pg_dumpall issues ALTER OWNER or SET SESSION AUTHORIZATION statements to set ownership of created schema elements. These statements will fail when the script is run unless it is started by a superuser (or the same user that owns all of the objects in the script). To make a script that can be restored by any user, but will give that user ownership of all the objects, specify -O ."},{"description":"Dump only roles, no databases or tablespaces.","names":["-r","--roles-only"],"signature":"-r --roles-only","source_url":"/docs/18/app-pg-dumpall.html","summary":"Dump only roles, no databases or tablespaces."},{"description":"Dump only the object definitions (schema), not data.","names":["-s","--schema-only"],"signature":"-s --schema-only","source_url":"/docs/18/app-pg-dumpall.html","summary":"Dump only the object definitions (schema), not data."},{"description":"Specify the superuser user name to use when disabling triggers. This is relevant only if --disable-triggers is used. (Usually, it's better to leave this out, and instead start the resulting script as superuser.)","names":["-S username","--superuser= username"],"signature":"-S username --superuser= username","source_url":"/docs/18/app-pg-dumpall.html","summary":"Specify the superuser user name to use when disabling triggers. This is relevant only if --disable-triggers is used. (Usually, it's better to leave this out, and instead start the resulting script as superuser.)"},{"description":"Dump only tablespaces, no databases or roles.","names":["-t","--tablespaces-only"],"signature":"-t --tablespaces-only","source_url":"/docs/18/app-pg-dumpall.html","summary":"Dump only tablespaces, no databases or roles."},{"description":"Specifies verbose mode. This will cause pg_dumpall to output start/stop times to the dump file, and progress messages to standard error. Repeating the option causes additional debug-level messages to appear on standard error. The option is also passed down to pg_dump .","names":["-v","--verbose"],"signature":"-v --verbose","source_url":"/docs/18/app-pg-dumpall.html","summary":"Specifies verbose mode. This will cause pg_dumpall to output start/stop times to the dump file, and progress messages to standard error. Repeating the option causes additional debug-level messages to appear on standard error. The option is also passed down to pg_dump ."},{"description":"Print the pg_dumpall version and exit.","names":["-V","--version"],"signature":"-V --version","source_url":"/docs/18/app-pg-dumpall.html","summary":"Print the pg_dumpall version and exit."},{"description":"Prevent dumping of access privileges (grant/revoke commands).","names":["-x","--no-privileges","--no-acl"],"signature":"-x --no-privileges --no-acl","source_url":"/docs/18/app-pg-dumpall.html","summary":"Prevent dumping of access privileges (grant/revoke commands)."},{"description":"This option is for use by in-place upgrade utilities. Its use for other purposes is not recommended or supported. The behavior of the option may change in future releases without notice.","names":["--binary-upgrade"],"signature":"--binary-upgrade","source_url":"/docs/18/app-pg-dumpall.html","summary":"This option is for use by in-place upgrade utilities. Its use for other purposes is not recommended or supported. The behavior of the option may change in future releases without notice."},{"description":"Dump data as INSERT commands with explicit column names ( INSERT INTO table ( column , ...) VALUES ... ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases.","names":["--column-inserts","--attribute-inserts"],"signature":"--column-inserts --attribute-inserts","source_url":"/docs/18/app-pg-dumpall.html","summary":"Dump data as INSERT commands with explicit column names ( INSERT INTO table ( column , ...) VALUES ... ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases."},{"description":"This option disables the use of dollar quoting for function bodies, and forces them to be quoted using SQL standard string syntax.","names":["--disable-dollar-quoting"],"signature":"--disable-dollar-quoting","source_url":"/docs/18/app-pg-dumpall.html","summary":"This option disables the use of dollar quoting for function bodies, and forces them to be quoted using SQL standard string syntax."},{"description":"This option is relevant only when creating a dump with data and without schema. It instructs pg_dumpall to include commands to temporarily disable triggers on the target tables while the data is restored. Use this if you have referential integrity checks or other triggers on the tables that you do not want to invoke during data restore. Presently, the commands emitted for --disable-triggers must be done as superuser. So, you should also specify a superuser name with -S , or preferably be careful to start the resulting script as a superuser.","names":["--disable-triggers"],"signature":"--disable-triggers","source_url":"/docs/18/app-pg-dumpall.html","summary":"This option is relevant only when creating a dump with data and without schema. It instructs pg_dumpall to include commands to temporarily disable triggers on the target tables while the data is restored. Use this if you have referential integrity checks or other triggers on the tables that you do not want to invoke during data restore."},{"description":"Do not dump databases whose name matches pattern . Multiple patterns can be excluded by writing multiple --exclude-database switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple databases can also be excluded by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent shell wildcard expansion.","names":["--exclude-database= pattern"],"signature":"--exclude-database= pattern","source_url":"/docs/18/app-pg-dumpall.html","summary":"Do not dump databases whose name matches pattern . Multiple patterns can be excluded by writing multiple --exclude-database switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple databases can also be excluded by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent shell wildcard expansion."},{"description":"Use the specified value of extra_float_digits when dumping floating-point data, instead of the maximum available precision. Routine dumps made for backup purposes should not use this option.","names":["--extra-float-digits= ndigits"],"signature":"--extra-float-digits= ndigits","source_url":"/docs/18/app-pg-dumpall.html","summary":"Use the specified value of extra_float_digits when dumping floating-point data, instead of the maximum available precision. Routine dumps made for backup purposes should not use this option."},{"description":"Specify a filename from which to read patterns for databases excluded from the dump. The patterns are interpreted according to the same rules as --exclude-database . To read from STDIN , use - as the filename. The --filter option can be specified in conjunction with --exclude-database for excluding databases, and can also be specified more than once for multiple filter files. The file lists one database pattern per row, with the following format: exclude database PATTERN Lines starting with # are considered comments and ignored. Comments can be placed after an object pattern row as well. Blank lines are also ignored. See Patterns for how to perform quoting in patterns.","names":["--filter= filename"],"signature":"--filter= filename","source_url":"/docs/18/app-pg-dumpall.html","summary":"Specify a filename from which to read patterns for databases excluded from the dump. The patterns are interpreted according to the same rules as --exclude-database . To read from STDIN , use - as the filename. The --filter option can be specified in conjunction with --exclude-database for excluding databases, and can also be specified more than once for multiple filter files."},{"description":"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 is also specified.","names":["--if-exists"],"signature":"--if-exists","source_url":"/docs/18/app-pg-dumpall.html","summary":"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 is also specified."},{"description":"Dump data as INSERT commands (rather than COPY ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. Note that the restore might fail altogether if you have rearranged column order. The --column-inserts option is safer, though even slower.","names":["--inserts"],"signature":"--inserts","source_url":"/docs/18/app-pg-dumpall.html","summary":"Dump data as INSERT commands (rather than COPY ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. Note that the restore might fail altogether if you have rearranged column order. The --column-inserts option is safer, though even slower."},{"description":"When dumping data for a table partition, make the COPY or INSERT statements target the root of the partitioning hierarchy that contains it, rather than the partition itself. This causes the appropriate partition to be re-determined for each row when the data is loaded. This may be useful when restoring data on a server where rows do not always fall into the same partitions as they did on the original server. That could happen, for example, if the partitioning column is of type text and the two systems have different definitions of the collation used to sort the partitioning column.","names":["--load-via-partition-root"],"signature":"--load-via-partition-root","source_url":"/docs/18/app-pg-dumpall.html","summary":"When dumping data for a table partition, make the COPY or INSERT statements target the root of the partitioning hierarchy that contains it, rather than the partition itself. This causes the appropriate partition to be re-determined for each row when the data is loaded. This may be useful when restoring data on a server where rows do not always fall into the same partitions as they did on the original server. That could happen, for example, if the partitioning column is of type text and the two systems have different definitions of the collation used to sort the partitioning column."},{"description":"Do not wait forever to acquire shared table locks at the beginning of the dump. Instead, fail if unable to lock a table within the specified timeout . The timeout may be specified in any of the formats accepted by SET statement_timeout .","names":["--lock-wait-timeout= timeout"],"signature":"--lock-wait-timeout= timeout","source_url":"/docs/18/app-pg-dumpall.html","summary":"Do not wait forever to acquire shared table locks at the beginning of the dump. Instead, fail if unable to lock a table within the specified timeout . The timeout may be specified in any of the formats accepted by SET statement_timeout ."},{"description":"Do not dump COMMENT commands.","names":["--no-comments"],"signature":"--no-comments","source_url":"/docs/18/app-pg-dumpall.html","summary":"Do not dump COMMENT commands."},{"description":"Do not dump data.","names":["--no-data"],"signature":"--no-data","source_url":"/docs/18/app-pg-dumpall.html","summary":"Do not dump data."},{"description":"Do not dump row security policies.","names":["--no-policies"],"signature":"--no-policies","source_url":"/docs/18/app-pg-dumpall.html","summary":"Do not dump row security policies."},{"description":"Do not dump publications.","names":["--no-publications"],"signature":"--no-publications","source_url":"/docs/18/app-pg-dumpall.html","summary":"Do not dump publications."},{"description":"Do not dump passwords for roles. When restored, roles will have a null password, and password authentication will always fail until the password is set. Since password values aren't needed when this option is specified, the role information is read from the catalog view pg_roles instead of pg_authid . Therefore, this option also helps if access to pg_authid is restricted by some security policy.","names":["--no-role-passwords"],"signature":"--no-role-passwords","source_url":"/docs/18/app-pg-dumpall.html","summary":"Do not dump passwords for roles. When restored, roles will have a null password, and password authentication will always fail until the password is set. Since password values aren't needed when this option is specified, the role information is read from the catalog view pg_roles instead of pg_authid . Therefore, this option also helps if access to pg_authid is restricted by some security policy."},{"description":"Do not dump schema (data definitions).","names":["--no-schema"],"signature":"--no-schema","source_url":"/docs/18/app-pg-dumpall.html","summary":"Do not dump schema (data definitions)."},{"description":"Do not dump security labels.","names":["--no-security-labels"],"signature":"--no-security-labels","source_url":"/docs/18/app-pg-dumpall.html","summary":"Do not dump security labels."},{"description":"Do not dump statistics. This is the default.","names":["--no-statistics"],"signature":"--no-statistics","source_url":"/docs/18/app-pg-dumpall.html","summary":"Do not dump statistics. This is the default."},{"description":"Do not dump subscriptions.","names":["--no-subscriptions"],"signature":"--no-subscriptions","source_url":"/docs/18/app-pg-dumpall.html","summary":"Do not dump subscriptions."},{"description":"By default, pg_dumpall will wait for all files to be written safely to disk. This option causes pg_dumpall to return without waiting, which is faster, but means that a subsequent operating system crash can leave the dump corrupt. Generally, this option is useful for testing but should not be used when dumping data from production installation.","names":["--no-sync"],"signature":"--no-sync","source_url":"/docs/18/app-pg-dumpall.html","summary":"By default, pg_dumpall will wait for all files to be written safely to disk. This option causes pg_dumpall to return without waiting, which is faster, but means that a subsequent operating system crash can leave the dump corrupt. Generally, this option is useful for testing but should not be used when dumping data from production installation."},{"description":"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.","names":["--no-table-access-method"],"signature":"--no-table-access-method","source_url":"/docs/18/app-pg-dumpall.html","summary":"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."},{"description":"Do not output commands to create tablespaces nor select tablespaces for objects. With this option, all objects will be created in whichever tablespace is the default during restore.","names":["--no-tablespaces"],"signature":"--no-tablespaces","source_url":"/docs/18/app-pg-dumpall.html","summary":"Do not output commands to create tablespaces nor select tablespaces for objects. With this option, all objects will be created in whichever tablespace is the default during restore."},{"description":"Do not output commands to set TOAST compression methods. With this option, all columns will be restored with the default compression setting.","names":["--no-toast-compression"],"signature":"--no-toast-compression","source_url":"/docs/18/app-pg-dumpall.html","summary":"Do not output commands to set TOAST compression methods. With this option, all columns will be restored with the default compression setting."},{"description":"Do not dump the contents of unlogged tables. This option has no effect on whether or not the table definitions (schema) are dumped; it only suppresses dumping the table data.","names":["--no-unlogged-table-data"],"signature":"--no-unlogged-table-data","source_url":"/docs/18/app-pg-dumpall.html","summary":"Do not dump the contents of unlogged tables. This option has no effect on whether or not the table definitions (schema) are dumped; it only suppresses dumping the table data."},{"description":"Add ON CONFLICT DO NOTHING to INSERT commands. This option is not valid unless --inserts or --column-inserts is also specified.","names":["--on-conflict-do-nothing"],"signature":"--on-conflict-do-nothing","source_url":"/docs/18/app-pg-dumpall.html","summary":"Add ON CONFLICT DO NOTHING to INSERT commands. This option is not valid unless --inserts or --column-inserts is also specified."},{"description":"Force quoting of all identifiers. This option is recommended when dumping a database from a server whose PostgreSQL major version is different from pg_dumpall 's, or when the output is intended to be loaded into a server of a different major version. By default, pg_dumpall quotes only identifiers that are reserved words in its own major version. This sometimes results in compatibility issues when dealing with servers of other versions that may have slightly different sets of reserved words. Using --quote-all-identifiers prevents such issues, at the price of a harder-to-read dump script.","names":["--quote-all-identifiers"],"signature":"--quote-all-identifiers","source_url":"/docs/18/app-pg-dumpall.html","summary":"Force quoting of all identifiers. This option is recommended when dumping a database from a server whose PostgreSQL major version is different from pg_dumpall 's, or when the output is intended to be loaded into a server of a different major version. By default, pg_dumpall quotes only identifiers that are reserved words in its own major version. This sometimes results in compatibility issues when dealing with servers of other versions that may have slightly different sets of reserved words. Using --quote-all-identifiers prevents such issues, at the price of a harder-to-read dump script."},{"description":"Use the provided string as the psql \\restrict key in the dump output. If no restrict key is specified, pg_dumpall will generate a random one as needed. Keys may contain only alphanumeric characters. This option is primarily intended for testing purposes and other scenarios that require repeatable output (e.g., comparing dump files). It is not recommended for general use, as a malicious server with advance knowledge of the key may be able to inject arbitrary code that will be executed on the machine that runs psql with the dump output.","names":["--restrict-key= restrict_key"],"signature":"--restrict-key= restrict_key","source_url":"/docs/18/app-pg-dumpall.html","summary":"Use the provided string as the psql \\restrict key in the dump output. If no restrict key is specified, pg_dumpall will generate a random one as needed. Keys may contain only alphanumeric characters."},{"description":"Dump data as INSERT commands (rather than COPY ). Controls the maximum number of rows per INSERT command. The value specified must be a number greater than zero. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents.","names":["--rows-per-insert= nrows"],"signature":"--rows-per-insert= nrows","source_url":"/docs/18/app-pg-dumpall.html","summary":"Dump data as INSERT commands (rather than COPY ). Controls the maximum number of rows per INSERT command. The value specified must be a number greater than zero. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents."},{"description":"Dump optimizer statistics.","names":["--statistics"],"signature":"--statistics","source_url":"/docs/18/app-pg-dumpall.html","summary":"Dump optimizer statistics."},{"description":"Dump only the statistics, not the schema (data definitions) or data. Optimizer statistics for tables, materialized views, foreign tables, and indexes are dumped.","names":["--statistics-only"],"signature":"--statistics-only","source_url":"/docs/18/app-pg-dumpall.html","summary":"Dump only the statistics, not the schema (data definitions) or data. Optimizer statistics for tables, materialized views, foreign tables, and indexes are dumped."},{"description":"Include sequence data in the dump. This is the default behavior except when --no-data , --schema-only , or --statistics-only is specified.","names":["--sequence-data"],"signature":"--sequence-data","source_url":"/docs/18/app-pg-dumpall.html","summary":"Include sequence data in the dump. This is the default behavior except when --no-data , --schema-only , or --statistics-only is specified."},{"description":"Output SQL-standard SET SESSION AUTHORIZATION commands instead of ALTER OWNER commands to determine object ownership. This makes the dump more standards compatible, but depending on the history of the objects in the dump, might not restore properly.","names":["--use-set-session-authorization"],"signature":"--use-set-session-authorization","source_url":"/docs/18/app-pg-dumpall.html","summary":"Output SQL-standard SET SESSION AUTHORIZATION commands instead of ALTER OWNER commands to determine object ownership. This makes the dump more standards compatible, but depending on the history of the objects in the dump, might not restore properly."},{"description":"Show help about pg_dumpall command line arguments, and exit.","names":["-?","--help"],"signature":"-? --help","source_url":"/docs/18/app-pg-dumpall.html","summary":"Show help about pg_dumpall command line arguments, and exit."},{"description":"Specifies parameters used to connect to the server, as a connection string ; these will override any conflicting command line options. The option is called --dbname for consistency with other client applications, but because pg_dumpall needs to connect to many databases, the database name in the connection string will be ignored. Use the -l option to specify the name of the database used for the initial connection, which will dump global objects and discover what other databases should be dumped.","names":["-d connstr","--dbname= connstr"],"signature":"-d connstr --dbname= connstr","source_url":"/docs/18/app-pg-dumpall.html","summary":"Specifies parameters used to connect to the server, as a connection string ; these will override any conflicting command line options."},{"description":"Specifies the host name of the machine on which the database server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket. The default is taken from the PGHOST environment variable, if set, else a Unix domain socket connection is attempted.","names":["-h host","--host= host"],"signature":"-h host --host= host","source_url":"/docs/18/app-pg-dumpall.html","summary":"Specifies the host name of the machine on which the database server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket. The default is taken from the PGHOST environment variable, if set, else a Unix domain socket connection is attempted."},{"description":"Specifies the name of the database to connect to for dumping global objects and discovering what other databases should be dumped. If not specified, the postgres database will be used, and if that does not exist, template1 will be used.","names":["-l dbname","--database= dbname"],"signature":"-l dbname --database= dbname","source_url":"/docs/18/app-pg-dumpall.html","summary":"Specifies the name of the database to connect to for dumping global objects and discovering what other databases should be dumped. If not specified, the postgres database will be used, and if that does not exist, template1 will be used."},{"description":"Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections. Defaults to the PGPORT environment variable, if set, or a compiled-in default.","names":["-p port","--port= port"],"signature":"-p port --port= port","source_url":"/docs/18/app-pg-dumpall.html","summary":"Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections. Defaults to the PGPORT environment variable, if set, or a compiled-in default."},{"description":"User name to connect as.","names":["-U username","--username= username"],"signature":"-U username --username= username","source_url":"/docs/18/app-pg-dumpall.html","summary":"User name to connect as."},{"description":"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 will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password.","names":["-w","--no-password"],"signature":"-w --no-password","source_url":"/docs/18/app-pg-dumpall.html","summary":"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 will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password."},{"description":"Force pg_dumpall to prompt for a password before connecting to a database. This option is never essential, since pg_dumpall will automatically prompt for a password if the server demands password authentication. However, pg_dumpall will waste a connection attempt finding out that the server wants a password. In some cases it is worth typing -W to avoid the extra connection attempt. Note that the password prompt will occur again for each database to be dumped. Usually, it's better to set up a ~/.pgpass file than to rely on manual password entry.","names":["-W","--password"],"signature":"-W --password","source_url":"/docs/18/app-pg-dumpall.html","summary":"Force pg_dumpall to prompt for a password before connecting to a database."},{"description":"Specifies a role name to be used to create the dump. This option causes pg_dumpall to issue a SET ROLE rolename command after connecting to the database. It is useful when the authenticated user (specified by -U ) lacks privileges needed by pg_dumpall , but can switch to a role with the required rights. Some installations have a policy against logging in directly as a superuser, and use of this option allows dumps to be made without violating the policy.","names":["--role= rolename"],"signature":"--role= rolename","source_url":"/docs/18/app-pg-dumpall.html","summary":"Specifies a role name to be used to create the dump. This option causes pg_dumpall to issue a SET ROLE rolename command after connecting to the database. It is useful when the authenticated user (specified by -U ) lacks privileges needed by pg_dumpall , but can switch to a role with the required rights. Some installations have a policy against logging in directly as a superuser, and use of this option allows dumps to be made without violating the policy."}],"related":[{"label":"libpq connection parameters","url":"/wiki/conn/?v=18"}],"release":{"channel":"stable","evidence_kind":"English manual and source declarations","label":"18.6","major":"18","manifest":{"index":"index.html","major":"18","pages":1148,"pdf":{"A4":{"built_at":"2026-09-26","bytes":15865106,"pages":3154,"sha256":"19512c405da53f9f7fcf0abba359223aa65f021be025bf3411381918f92e3190","url":"/files/documentation/pdf/18/postgresql-18-A4.pdf"},"US":{"built_at":"2026-09-26","bytes":15748059,"pages":3328,"sha256":"facbe6c229e598b872d3d98bef53308f46e06746006fa4590de9a7de9dd46319","url":"/files/documentation/pdf/18/postgresql-18-US.pdf"}},"release":"18.6","source_mode":"en SGML built with pinned official archive","source_sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","source_url":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2","svg_assets":3,"tree":"18"},"ref":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2","revision":"ee8d1a3612338fd9adf250730cb640fcc5233b5491337cc00a316a44e3a0b9f8","source_sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f"},"sections":[],"signature":"pg_dumpall [ connection-option ...] [ option ...]","sources":[{"anchor":"","file":"app-pg-dumpall.html","label":"18.6 English manual · app-pg-dumpall.html","sha256":"5f64e2921cefa4823764e46860b95e0f5f7568192670220a0bac10314c740683","url":"/docs/18/app-pg-dumpall.html"},{"anchor":"","file":"reference-client.html","label":"Client applications inventory","sha256":"68f726af77272fe73a827be2b7b5958d0f2239a6f8ed44264e9d42496bfa4fd0","url":"/docs/18/reference-client.html"}],"synopsis":["pg_dumpall [ connection-option ...] [ option ...]"],"tables":[{"columns":[{"key":"signature","label":"Option and arguments"},{"key":"summary","label":"Description"}],"key":"options","rows":[{"signature":{"text":"-a --data-only","url":"/docs/18/app-pg-dumpall.html"},"summary":"Dump only the data, not the schema (data definitions) or statistics."},{"signature":{"text":"-c --clean","url":"/docs/18/app-pg-dumpall.html"},"summary":"Emit SQL commands to DROP all the dumped databases, roles, and tablespaces before recreating them. This option is useful when the restore is to overwrite an existing cluster. If any of the objects do not exist in the destination cluster, ignorable error messages will be reported during restore, unless --if-exists is also specified."},{"signature":{"text":"-E encoding --encoding= encoding","url":"/docs/18/app-pg-dumpall.html"},"summary":"Create the dump in the specified character set encoding. By default, the dump is created in the database encoding. (Another way to get the same result is to set the PGCLIENTENCODING environment variable to the desired dump encoding.)"},{"signature":{"text":"-f filename --file= filename","url":"/docs/18/app-pg-dumpall.html"},"summary":"Send output to the specified file. If this is omitted, the standard output is used."},{"signature":{"text":"-g --globals-only","url":"/docs/18/app-pg-dumpall.html"},"summary":"Dump only global objects (roles and tablespaces), no databases."},{"signature":{"text":"-O --no-owner","url":"/docs/18/app-pg-dumpall.html"},"summary":"Do not output commands to set ownership of objects to match the original database. By default, pg_dumpall issues ALTER OWNER or SET SESSION AUTHORIZATION statements to set ownership of created schema elements. These statements will fail when the script is run unless it is started by a superuser (or the same user that owns all of the objects in the script). To make a script that can be restored by any user, but will give that user ownership of all the objects, specify -O ."},{"signature":{"text":"-r --roles-only","url":"/docs/18/app-pg-dumpall.html"},"summary":"Dump only roles, no databases or tablespaces."},{"signature":{"text":"-s --schema-only","url":"/docs/18/app-pg-dumpall.html"},"summary":"Dump only the object definitions (schema), not data."},{"signature":{"text":"-S username --superuser= username","url":"/docs/18/app-pg-dumpall.html"},"summary":"Specify the superuser user name to use when disabling triggers. This is relevant only if --disable-triggers is used. (Usually, it's better to leave this out, and instead start the resulting script as superuser.)"},{"signature":{"text":"-t --tablespaces-only","url":"/docs/18/app-pg-dumpall.html"},"summary":"Dump only tablespaces, no databases or roles."},{"signature":{"text":"-v --verbose","url":"/docs/18/app-pg-dumpall.html"},"summary":"Specifies verbose mode. This will cause pg_dumpall to output start/stop times to the dump file, and progress messages to standard error. Repeating the option causes additional debug-level messages to appear on standard error. The option is also passed down to pg_dump ."},{"signature":{"text":"-V --version","url":"/docs/18/app-pg-dumpall.html"},"summary":"Print the pg_dumpall version and exit."},{"signature":{"text":"-x --no-privileges --no-acl","url":"/docs/18/app-pg-dumpall.html"},"summary":"Prevent dumping of access privileges (grant/revoke commands)."},{"signature":{"text":"--binary-upgrade","url":"/docs/18/app-pg-dumpall.html"},"summary":"This option is for use by in-place upgrade utilities. Its use for other purposes is not recommended or supported. The behavior of the option may change in future releases without notice."},{"signature":{"text":"--column-inserts --attribute-inserts","url":"/docs/18/app-pg-dumpall.html"},"summary":"Dump data as INSERT commands with explicit column names ( INSERT INTO table ( column , ...) VALUES ... ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases."},{"signature":{"text":"--disable-dollar-quoting","url":"/docs/18/app-pg-dumpall.html"},"summary":"This option disables the use of dollar quoting for function bodies, and forces them to be quoted using SQL standard string syntax."},{"signature":{"text":"--disable-triggers","url":"/docs/18/app-pg-dumpall.html"},"summary":"This option is relevant only when creating a dump with data and without schema. It instructs pg_dumpall to include commands to temporarily disable triggers on the target tables while the data is restored. Use this if you have referential integrity checks or other triggers on the tables that you do not want to invoke during data restore."},{"signature":{"text":"--exclude-database= pattern","url":"/docs/18/app-pg-dumpall.html"},"summary":"Do not dump databases whose name matches pattern . Multiple patterns can be excluded by writing multiple --exclude-database switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple databases can also be excluded by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent shell wildcard expansion."},{"signature":{"text":"--extra-float-digits= ndigits","url":"/docs/18/app-pg-dumpall.html"},"summary":"Use the specified value of extra_float_digits when dumping floating-point data, instead of the maximum available precision. Routine dumps made for backup purposes should not use this option."},{"signature":{"text":"--filter= filename","url":"/docs/18/app-pg-dumpall.html"},"summary":"Specify a filename from which to read patterns for databases excluded from the dump. The patterns are interpreted according to the same rules as --exclude-database . To read from STDIN , use - as the filename. The --filter option can be specified in conjunction with --exclude-database for excluding databases, and can also be specified more than once for multiple filter files."},{"signature":{"text":"--if-exists","url":"/docs/18/app-pg-dumpall.html"},"summary":"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 is also specified."},{"signature":{"text":"--inserts","url":"/docs/18/app-pg-dumpall.html"},"summary":"Dump data as INSERT commands (rather than COPY ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. Note that the restore might fail altogether if you have rearranged column order. The --column-inserts option is safer, though even slower."},{"signature":{"text":"--load-via-partition-root","url":"/docs/18/app-pg-dumpall.html"},"summary":"When dumping data for a table partition, make the COPY or INSERT statements target the root of the partitioning hierarchy that contains it, rather than the partition itself. This causes the appropriate partition to be re-determined for each row when the data is loaded. This may be useful when restoring data on a server where rows do not always fall into the same partitions as they did on the original server. That could happen, for example, if the partitioning column is of type text and the two systems have different definitions of the collation used to sort the partitioning column."},{"signature":{"text":"--lock-wait-timeout= timeout","url":"/docs/18/app-pg-dumpall.html"},"summary":"Do not wait forever to acquire shared table locks at the beginning of the dump. Instead, fail if unable to lock a table within the specified timeout . The timeout may be specified in any of the formats accepted by SET statement_timeout ."},{"signature":{"text":"--no-comments","url":"/docs/18/app-pg-dumpall.html"},"summary":"Do not dump COMMENT commands."},{"signature":{"text":"--no-data","url":"/docs/18/app-pg-dumpall.html"},"summary":"Do not dump data."},{"signature":{"text":"--no-policies","url":"/docs/18/app-pg-dumpall.html"},"summary":"Do not dump row security policies."},{"signature":{"text":"--no-publications","url":"/docs/18/app-pg-dumpall.html"},"summary":"Do not dump publications."},{"signature":{"text":"--no-role-passwords","url":"/docs/18/app-pg-dumpall.html"},"summary":"Do not dump passwords for roles. When restored, roles will have a null password, and password authentication will always fail until the password is set. Since password values aren't needed when this option is specified, the role information is read from the catalog view pg_roles instead of pg_authid . Therefore, this option also helps if access to pg_authid is restricted by some security policy."},{"signature":{"text":"--no-schema","url":"/docs/18/app-pg-dumpall.html"},"summary":"Do not dump schema (data definitions)."},{"signature":{"text":"--no-security-labels","url":"/docs/18/app-pg-dumpall.html"},"summary":"Do not dump security labels."},{"signature":{"text":"--no-statistics","url":"/docs/18/app-pg-dumpall.html"},"summary":"Do not dump statistics. This is the default."},{"signature":{"text":"--no-subscriptions","url":"/docs/18/app-pg-dumpall.html"},"summary":"Do not dump subscriptions."},{"signature":{"text":"--no-sync","url":"/docs/18/app-pg-dumpall.html"},"summary":"By default, pg_dumpall will wait for all files to be written safely to disk. This option causes pg_dumpall to return without waiting, which is faster, but means that a subsequent operating system crash can leave the dump corrupt. Generally, this option is useful for testing but should not be used when dumping data from production installation."},{"signature":{"text":"--no-table-access-method","url":"/docs/18/app-pg-dumpall.html"},"summary":"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."},{"signature":{"text":"--no-tablespaces","url":"/docs/18/app-pg-dumpall.html"},"summary":"Do not output commands to create tablespaces nor select tablespaces for objects. With this option, all objects will be created in whichever tablespace is the default during restore."},{"signature":{"text":"--no-toast-compression","url":"/docs/18/app-pg-dumpall.html"},"summary":"Do not output commands to set TOAST compression methods. With this option, all columns will be restored with the default compression setting."},{"signature":{"text":"--no-unlogged-table-data","url":"/docs/18/app-pg-dumpall.html"},"summary":"Do not dump the contents of unlogged tables. This option has no effect on whether or not the table definitions (schema) are dumped; it only suppresses dumping the table data."},{"signature":{"text":"--on-conflict-do-nothing","url":"/docs/18/app-pg-dumpall.html"},"summary":"Add ON CONFLICT DO NOTHING to INSERT commands. This option is not valid unless --inserts or --column-inserts is also specified."},{"signature":{"text":"--quote-all-identifiers","url":"/docs/18/app-pg-dumpall.html"},"summary":"Force quoting of all identifiers. This option is recommended when dumping a database from a server whose PostgreSQL major version is different from pg_dumpall 's, or when the output is intended to be loaded into a server of a different major version. By default, pg_dumpall quotes only identifiers that are reserved words in its own major version. This sometimes results in compatibility issues when dealing with servers of other versions that may have slightly different sets of reserved words. Using --quote-all-identifiers prevents such issues, at the price of a harder-to-read dump script."},{"signature":{"text":"--restrict-key= restrict_key","url":"/docs/18/app-pg-dumpall.html"},"summary":"Use the provided string as the psql \\restrict key in the dump output. If no restrict key is specified, pg_dumpall will generate a random one as needed. Keys may contain only alphanumeric characters."},{"signature":{"text":"--rows-per-insert= nrows","url":"/docs/18/app-pg-dumpall.html"},"summary":"Dump data as INSERT commands (rather than COPY ). Controls the maximum number of rows per INSERT command. The value specified must be a number greater than zero. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents."},{"signature":{"text":"--statistics","url":"/docs/18/app-pg-dumpall.html"},"summary":"Dump optimizer statistics."},{"signature":{"text":"--statistics-only","url":"/docs/18/app-pg-dumpall.html"},"summary":"Dump only the statistics, not the schema (data definitions) or data. Optimizer statistics for tables, materialized views, foreign tables, and indexes are dumped."},{"signature":{"text":"--sequence-data","url":"/docs/18/app-pg-dumpall.html"},"summary":"Include sequence data in the dump. This is the default behavior except when --no-data , --schema-only , or --statistics-only is specified."},{"signature":{"text":"--use-set-session-authorization","url":"/docs/18/app-pg-dumpall.html"},"summary":"Output SQL-standard SET SESSION AUTHORIZATION commands instead of ALTER OWNER commands to determine object ownership. This makes the dump more standards compatible, but depending on the history of the objects in the dump, might not restore properly."},{"signature":{"text":"-? --help","url":"/docs/18/app-pg-dumpall.html"},"summary":"Show help about pg_dumpall command line arguments, and exit."},{"signature":{"text":"-d connstr --dbname= connstr","url":"/docs/18/app-pg-dumpall.html"},"summary":"Specifies parameters used to connect to the server, as a connection string ; these will override any conflicting command line options."},{"signature":{"text":"-h host --host= host","url":"/docs/18/app-pg-dumpall.html"},"summary":"Specifies the host name of the machine on which the database server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket. The default is taken from the PGHOST environment variable, if set, else a Unix domain socket connection is attempted."},{"signature":{"text":"-l dbname --database= dbname","url":"/docs/18/app-pg-dumpall.html"},"summary":"Specifies the name of the database to connect to for dumping global objects and discovering what other databases should be dumped. If not specified, the postgres database will be used, and if that does not exist, template1 will be used."},{"signature":{"text":"-p port --port= port","url":"/docs/18/app-pg-dumpall.html"},"summary":"Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections. Defaults to the PGPORT environment variable, if set, or a compiled-in default."},{"signature":{"text":"-U username --username= username","url":"/docs/18/app-pg-dumpall.html"},"summary":"User name to connect as."},{"signature":{"text":"-w --no-password","url":"/docs/18/app-pg-dumpall.html"},"summary":"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 will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password."},{"signature":{"text":"-W --password","url":"/docs/18/app-pg-dumpall.html"},"summary":"Force pg_dumpall to prompt for a password before connecting to a database."},{"signature":{"text":"--role= rolename","url":"/docs/18/app-pg-dumpall.html"},"summary":"Specifies a role name to be used to create the dump. This option causes pg_dumpall to issue a SET ROLE rolename command after connecting to the database. It is useful when the authenticated user (specified by -U ) lacks privileges needed by pg_dumpall , but can switch to a role with the required rights. Some installations have a policy against logging in directly as a superuser, and use of this option allows dumps to be made without violating the policy."}],"title":"Documented options"},{"columns":[{"key":"name","label":"Variable"},{"key":"description","label":"Meaning"}],"key":"environment","rows":[{"description":"Default connection parameters","name":"PGHOST PGOPTIONS PGPORT PGUSER"},{"description":"Specifies whether to use color in diagnostic messages. Possible values are always , auto and never .","name":"PG_COLOR"}],"title":"Environment variables"}]},"ManualEvidence":{"manual_path":"app-pg-dumpall.html","release":{"channel":"stable","evidence_kind":"English manual and source declarations","label":"18.6","major":"18","manifest":{"index":"index.html","major":"18","pages":1148,"pdf":{"A4":{"built_at":"2026-09-26","bytes":15865106,"pages":3154,"sha256":"19512c405da53f9f7fcf0abba359223aa65f021be025bf3411381918f92e3190","url":"/files/documentation/pdf/18/postgresql-18-A4.pdf"},"US":{"built_at":"2026-09-26","bytes":15748059,"pages":3328,"sha256":"facbe6c229e598b872d3d98bef53308f46e06746006fa4590de9a7de9dd46319","url":"/files/documentation/pdf/18/postgresql-18-US.pdf"}},"release":"18.6","source_mode":"en SGML built with pinned official archive","source_sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","source_url":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2","svg_assets":3,"tree":"18"},"ref":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2","revision":"ee8d1a3612338fd9adf250730cb640fcc5233b5491337cc00a316a44e3a0b9f8","source_sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f"},"sources":[{"anchor":"","file":"app-pg-dumpall.html","label":"18.6 English manual · app-pg-dumpall.html","sha256":"5f64e2921cefa4823764e46860b95e0f5f7568192670220a0bac10314c740683","url":"/docs/18/app-pg-dumpall.html"},{"anchor":"","file":"reference-client.html","label":"Client applications inventory","sha256":"68f726af77272fe73a827be2b7b5958d0f2239a6f8ed44264e9d42496bfa4fd0","url":"/docs/18/reference-client.html"}]},"MeasuredEvidence":{}},"Text":{"Collection":"tool","Key":"pg-dumpall","SourceDatabase":"center","Version":"18","Locale":"en","Title":"pg_dumpall","Summary":"pg_dumpall — extract a PostgreSQL database cluster into a script file","BodyHTML":"\u003cdiv\u003e\u003cdiv id=\"APP-PG-DUMPALL\"\u003e\n\u003cdiv\u003e\u003c/div\u003e\n\u003cdiv\u003e\n\u003ch2\u003e\u003cspan\u003e\u003cspan\u003epg_dumpall\u003c/span\u003e\u003c/span\u003e\u003c/h2\u003e\n\u003cp\u003epg_dumpall — extract a \u003cspan\u003ePostgreSQL\u003c/span\u003e database cluster into a script file\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv\u003e\n\u003ch2\u003eSynopsis\u003c/h2\u003e\n\u003cdiv\u003e\n\u003cp id=\"id-1.9.4.15.4.1\"\u003e\u003ccode\u003epg_dumpall\u003c/code\u003e [\u003cem\u003e\u003ccode\u003econnection-option\u003c/code\u003e\u003c/em\u003e...] [\u003cem\u003e\u003ccode\u003eoption\u003c/code\u003e\u003c/em\u003e...]\u003c/p\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv id=\"APP-PG-DUMPALL-DESCRIPTION\"\u003e\n\u003ch2\u003eDescription\u003c/h2\u003e\n\u003cp\u003e\u003cspan\u003epg_dumpall\u003c/span\u003e is a utility for writing out (\u003cspan\u003e“\u003cspan\u003edumping\u003c/span\u003e”\u003c/span\u003e) all \u003cspan\u003ePostgreSQL\u003c/span\u003e databases of a cluster into one script file. The script file contains SQL commands that can be used as input to \u003ca href=\"/docs/18/app-psql.html\" title=\"psql\" rel=\"nofollow\"\u003e\u003cspan\u003e\u003cspan\u003epsql\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e to restore the databases. It does this by calling \u003ca href=\"/docs/18/app-pgdump.html\" title=\"pg_dump\" rel=\"nofollow\"\u003e\u003cspan\u003e\u003cspan\u003epg_dump\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e for each database in the cluster. \u003cspan\u003epg_dumpall\u003c/span\u003e also dumps global objects that are common to all databases, namely database roles, tablespaces, and privilege grants for configuration parameters. (\u003cspan\u003epg_dump\u003c/span\u003e does not save these objects.)\u003c/p\u003e\n\u003cp\u003eSince \u003cspan\u003epg_dumpall\u003c/span\u003e reads tables from all databases you will most likely have to connect as a database superuser in order to produce a complete dump. Also you will need superuser privileges to execute the saved script in order to be allowed to add roles and create databases.\u003c/p\u003e\n\u003cp\u003eThe SQL script will be written to the standard output. Use the \u003ccode\u003e-f\u003c/code\u003e/\u003ccode\u003e--file\u003c/code\u003e option or shell operators to redirect it into a file.\u003c/p\u003e\n\u003cp\u003e\u003cspan\u003epg_dumpall\u003c/span\u003e needs to connect several times to the \u003cspan\u003ePostgreSQL\u003c/span\u003e server (once per database). If you use password authentication it will ask for a password each time. It is convenient to have a \u003ccode\u003e~/.pgpass\u003c/code\u003e file in such cases. See \u003ca href=\"/docs/18/libpq-pgpass.html\" rel=\"nofollow\"\u003eSection 32.16\u003c/a\u003e for more information.\u003c/p\u003e\n\u003cdiv\u003e\n\u003ch3\u003eWarning\u003c/h3\u003e\n\u003cp\u003eRestoring a dump causes the destination to execute arbitrary code of the source superusers\u0026#39; choice. Partial dumps and partial restores do not limit that. If the source superusers are not trusted, the dumped SQL statements must be inspected before restoring. Note that the client running the dump and restore need not trust the source or destination superusers.\u003c/p\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv id=\"id-1.9.4.15.6\"\u003e\n\u003ch2\u003eOptions\u003c/h2\u003e\n\u003cp\u003eThe following command-line options control the content and format of the output.\u003c/p\u003e\n\u003cdiv\u003e\n\u003cdl\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-a\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--data-only\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDump only the data, not the schema (data definitions) or statistics.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-c\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--clean\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eEmit SQL commands to \u003ccode\u003eDROP\u003c/code\u003e all the dumped databases, roles, and tablespaces before recreating them. This option is useful when the restore is to overwrite an existing cluster. If any of the objects do not exist in the destination cluster, ignorable error messages will be reported during restore, unless \u003ccode\u003e--if-exists\u003c/code\u003e is also specified.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-E \u003cem\u003e\u003ccode\u003eencoding\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--encoding=\u003cem\u003e\u003ccode\u003eencoding\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eCreate the dump in the specified character set encoding. By default, the dump is created in the database encoding. (Another way to get the same result is to set the \u003ccode\u003ePGCLIENTENCODING\u003c/code\u003e environment variable to the desired dump encoding.)\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-f \u003cem\u003e\u003ccode\u003efilename\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--file=\u003cem\u003e\u003ccode\u003efilename\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSend output to the specified file. If this is omitted, the standard output is used.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-g\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--globals-only\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDump only global objects (roles and tablespaces), no databases.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-O\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--no-owner\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDo not output commands to set ownership of objects to match the original database. By default, \u003cspan\u003epg_dumpall\u003c/span\u003e issues \u003ccode\u003eALTER OWNER\u003c/code\u003e or \u003ccode\u003eSET SESSION AUTHORIZATION\u003c/code\u003e statements to set ownership of created schema elements. These statements will fail when the script is run unless it is started by a superuser (or the same user that owns all of the objects in the script). To make a script that can be restored by any user, but will give that user ownership of all the objects, specify \u003ccode\u003e-O\u003c/code\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-r\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--roles-only\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDump only roles, no databases or tablespaces.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-s\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--schema-only\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDump only the object definitions (schema), not data.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-S \u003cem\u003e\u003ccode\u003eusername\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--superuser=\u003cem\u003e\u003ccode\u003eusername\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecify the superuser user name to use when disabling triggers. This is relevant only if \u003ccode\u003e--disable-triggers\u003c/code\u003e is used. (Usually, it\u0026#39;s better to leave this out, and instead start the resulting script as superuser.)\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-t\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--tablespaces-only\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDump only tablespaces, no databases or roles.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-v\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--verbose\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies verbose mode. This will cause \u003cspan\u003epg_dumpall\u003c/span\u003e to output start/stop times to the dump file, and progress messages to standard error. Repeating the option causes additional debug-level messages to appear on standard error. The option is also passed down to \u003cspan\u003epg_dump\u003c/span\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-V\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--version\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint the \u003cspan\u003epg_dumpall\u003c/span\u003e version and exit.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-x\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--no-privileges\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--no-acl\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrevent dumping of access privileges (grant/revoke commands).\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--binary-upgrade\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eThis option is for use by in-place upgrade utilities. Its use for other purposes is not recommended or supported. The behavior of the option may change in future releases without notice.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--column-inserts\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--attribute-inserts\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDump data as \u003ccode\u003eINSERT\u003c/code\u003e commands with explicit column names (\u003ccode\u003eINSERT INTO \u003cem\u003e\u003ccode\u003etable\u003c/code\u003e\u003c/em\u003e (\u003cem\u003e\u003ccode\u003ecolumn\u003c/code\u003e\u003c/em\u003e, ...) VALUES ...\u003c/code\u003e). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non-\u003cspan\u003ePostgreSQL\u003c/span\u003e databases.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--disable-dollar-quoting\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eThis option disables the use of dollar quoting for function bodies, and forces them to be quoted using SQL standard string syntax.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--disable-triggers\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eThis option is relevant only when creating a dump with data and without schema. It instructs \u003cspan\u003epg_dumpall\u003c/span\u003e to include commands to temporarily disable triggers on the target tables while the data is restored. Use this if you have referential integrity checks or other triggers on the tables that you do not want to invoke during data restore.\u003c/p\u003e\n\u003cp\u003ePresently, the commands emitted for \u003ccode\u003e--disable-triggers\u003c/code\u003e must be done as superuser. So, you should also specify a superuser name with \u003ccode\u003e-S\u003c/code\u003e, or preferably be careful to start the resulting script as a superuser.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--exclude-database=\u003cem\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDo not dump databases whose name matches \u003cem\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e. Multiple patterns can be excluded by writing multiple \u003ccode\u003e--exclude-database\u003c/code\u003e switches. The \u003cem\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e parameter is interpreted as a pattern according to the same rules used by \u003cspan\u003epsql\u003c/span\u003e\u0026#39;s \u003ccode\u003e\\d\u003c/code\u003e commands (see \u003ca href=\"/docs/18/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\" rel=\"nofollow\"\u003ePatterns\u003c/a\u003e), so multiple databases can also be excluded by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent shell wildcard expansion.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--extra-float-digits=\u003cem\u003e\u003ccode\u003endigits\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eUse the specified value of extra_float_digits when dumping floating-point data, instead of the maximum available precision. Routine dumps made for backup purposes should not use this option.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--filter=\u003cem\u003e\u003ccode\u003efilename\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecify a filename from which to read patterns for databases excluded from the dump. The patterns are interpreted according to the same rules as \u003ccode\u003e--exclude-database\u003c/code\u003e. To read from \u003ccode\u003eSTDIN\u003c/code\u003e, use \u003ccode\u003e-\u003c/code\u003e as the filename. The \u003ccode\u003e--filter\u003c/code\u003e option can be specified in conjunction with \u003ccode\u003e--exclude-database\u003c/code\u003e for excluding databases, and can also be specified more than once for multiple filter files.\u003c/p\u003e\n\u003cp\u003eThe file lists one database pattern per row, with the following format:\u003c/p\u003e\n\u003cpre\u003eexclude database \u003cem\u003e\u003ccode\u003ePATTERN\u003c/code\u003e\u003c/em\u003e\n\u003c/pre\u003e\n\u003cp\u003eLines starting with \u003ccode\u003e#\u003c/code\u003e are considered comments and ignored. Comments can be placed after an object pattern row as well. Blank lines are also ignored. See \u003ca href=\"/docs/18/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\" rel=\"nofollow\"\u003ePatterns\u003c/a\u003e for how to perform quoting in patterns.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--if-exists\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eUse \u003ccode\u003eDROP ... IF EXISTS\u003c/code\u003e commands to drop objects in \u003ccode\u003e--clean\u003c/code\u003e mode. This suppresses \u003cspan\u003e“\u003cspan\u003edoes not exist\u003c/span\u003e”\u003c/span\u003e errors that might otherwise be reported. This option is not valid unless \u003ccode\u003e--clean\u003c/code\u003e is also specified.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--inserts\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDump data as \u003ccode\u003eINSERT\u003c/code\u003e commands (rather than \u003ccode\u003eCOPY\u003c/code\u003e). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non-\u003cspan\u003ePostgreSQL\u003c/span\u003e databases. Note that the restore might fail altogether if you have rearranged column order. The \u003ccode\u003e--column-inserts\u003c/code\u003e option is safer, though even slower.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--load-via-partition-root\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eWhen dumping data for a table partition, make the \u003ccode\u003eCOPY\u003c/code\u003e or \u003ccode\u003eINSERT\u003c/code\u003e statements target the root of the partitioning hierarchy that contains it, rather than the partition itself. This causes the appropriate partition to be re-determined for each row when the data is loaded. This may be useful when restoring data on a server where rows do not always fall into the same partitions as they did on the original server. That could happen, for example, if the partitioning column is of type text and the two systems have different definitions of the collation used to sort the partitioning column.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--lock-wait-timeout=\u003cem\u003e\u003ccode\u003etimeout\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDo not wait forever to acquire shared table locks at the beginning of the dump. Instead, fail if unable to lock a table within the specified \u003cem\u003e\u003ccode\u003etimeout\u003c/code\u003e\u003c/em\u003e. The timeout may be specified in any of the formats accepted by \u003ccode\u003eSET statement_timeout\u003c/code\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--no-comments\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDo not dump \u003ccode\u003eCOMMENT\u003c/code\u003e commands.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--no-data\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDo not dump data.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--no-policies\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDo not dump row security policies.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--no-publications\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDo not dump publications.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--no-role-passwords\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDo not dump passwords for roles. When restored, roles will have a null password, and password authentication will always fail until the password is set. Since password values aren\u0026#39;t needed when this option is specified, the role information is read from the catalog view \u003ccode\u003epg_roles\u003c/code\u003e instead of \u003ccode\u003epg_authid\u003c/code\u003e. Therefore, this option also helps if access to \u003ccode\u003epg_authid\u003c/code\u003e is restricted by some security policy.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--no-schema\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDo not dump schema (data definitions).\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--no-security-labels\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDo not dump security labels.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--no-statistics\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDo not dump statistics. This is the default.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--no-subscriptions\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDo not dump subscriptions.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--no-sync\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eBy default, \u003ccode\u003epg_dumpall\u003c/code\u003e will wait for all files to be written safely to disk. This option causes \u003ccode\u003epg_dumpall\u003c/code\u003e to return without waiting, which is faster, but means that a subsequent operating system crash can leave the dump corrupt. Generally, this option is useful for testing but should not be used when dumping data from production installation.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--no-table-access-method\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDo 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.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--no-tablespaces\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDo not output commands to create tablespaces nor select tablespaces for objects. With this option, all objects will be created in whichever tablespace is the default during restore.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--no-toast-compression\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDo not output commands to set TOAST compression methods. With this option, all columns will be restored with the default compression setting.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--no-unlogged-table-data\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDo not dump the contents of unlogged tables. This option has no effect on whether or not the table definitions (schema) are dumped; it only suppresses dumping the table data.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--on-conflict-do-nothing\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eAdd \u003ccode\u003eON CONFLICT DO NOTHING\u003c/code\u003e to \u003ccode\u003eINSERT\u003c/code\u003e commands. This option is not valid unless \u003ccode\u003e--inserts\u003c/code\u003e or \u003ccode\u003e--column-inserts\u003c/code\u003e is also specified.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--quote-all-identifiers\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eForce quoting of all identifiers. This option is recommended when dumping a database from a server whose \u003cspan\u003ePostgreSQL\u003c/span\u003e major version is different from \u003cspan\u003epg_dumpall\u003c/span\u003e\u0026#39;s, or when the output is intended to be loaded into a server of a different major version. By default, \u003cspan\u003epg_dumpall\u003c/span\u003e quotes only identifiers that are reserved words in its own major version. This sometimes results in compatibility issues when dealing with servers of other versions that may have slightly different sets of reserved words. Using \u003ccode\u003e--quote-all-identifiers\u003c/code\u003e prevents such issues, at the price of a harder-to-read dump script.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--restrict-key=\u003cem\u003e\u003ccode\u003erestrict_key\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eUse the provided string as the \u003cspan\u003epsql\u003c/span\u003e \u003ccode\u003e\\restrict\u003c/code\u003e key in the dump output. If no restrict key is specified, \u003cspan\u003epg_dumpall\u003c/span\u003e will generate a random one as needed. Keys may contain only alphanumeric characters.\u003c/p\u003e\n\u003cp\u003eThis option is primarily intended for testing purposes and other scenarios that require repeatable output (e.g., comparing dump files). It is not recommended for general use, as a malicious server with advance knowledge of the key may be able to inject arbitrary code that will be executed on the machine that runs \u003cspan\u003epsql\u003c/span\u003e with the dump output.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--rows-per-insert=\u003cem\u003e\u003ccode\u003enrows\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDump data as \u003ccode\u003eINSERT\u003c/code\u003e commands (rather than \u003ccode\u003eCOPY\u003c/code\u003e). Controls the maximum number of rows per \u003ccode\u003eINSERT\u003c/code\u003e command. The value specified must be a number greater than zero. Any error during restoring will cause only rows that are part of the problematic \u003ccode\u003eINSERT\u003c/code\u003e to be lost, rather than the entire table contents.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--statistics\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDump optimizer statistics.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--statistics-only\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDump only the statistics, not the schema (data definitions) or data. Optimizer statistics for tables, materialized views, foreign tables, and indexes are dumped.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--sequence-data\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eInclude sequence data in the dump. This is the default behavior except when \u003ccode\u003e--no-data\u003c/code\u003e, \u003ccode\u003e--schema-only\u003c/code\u003e, or \u003ccode\u003e--statistics-only\u003c/code\u003e is specified.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--use-set-session-authorization\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eOutput SQL-standard \u003ccode\u003eSET SESSION AUTHORIZATION\u003c/code\u003e commands instead of \u003ccode\u003eALTER OWNER\u003c/code\u003e commands to determine object ownership. This makes the dump more standards compatible, but depending on the history of the objects in the dump, might not restore properly.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-?\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--help\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eShow help about \u003cspan\u003epg_dumpall\u003c/span\u003e command line arguments, and exit.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003cp\u003eThe following command-line options control the database connection parameters.\u003c/p\u003e\n\u003cdiv\u003e\n\u003cdl\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-d \u003cem\u003e\u003ccode\u003econnstr\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--dbname=\u003cem\u003e\u003ccode\u003econnstr\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies parameters used to connect to the server, as a \u003ca href=\"/docs/18/libpq-connect.html#LIBPQ-CONNSTRING\" rel=\"nofollow\"\u003econnection string\u003c/a\u003e; these will override any conflicting command line options.\u003c/p\u003e\n\u003cp\u003eThe option is called \u003ccode\u003e--dbname\u003c/code\u003e for consistency with other client applications, but because \u003cspan\u003epg_dumpall\u003c/span\u003e needs to connect to many databases, the database name in the connection string will be ignored. Use the \u003ccode\u003e-l\u003c/code\u003e option to specify the name of the database used for the initial connection, which will dump global objects and discover what other databases should be dumped.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-h \u003cem\u003e\u003ccode\u003ehost\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--host=\u003cem\u003e\u003ccode\u003ehost\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies the host name of the machine on which the database server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket. The default is taken from the \u003ccode\u003ePGHOST\u003c/code\u003e environment variable, if set, else a Unix domain socket connection is attempted.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-l \u003cem\u003e\u003ccode\u003edbname\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--database=\u003cem\u003e\u003ccode\u003edbname\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies the name of the database to connect to for dumping global objects and discovering what other databases should be dumped. If not specified, the \u003ccode\u003epostgres\u003c/code\u003e database will be used, and if that does not exist, \u003ccode\u003etemplate1\u003c/code\u003e will be used.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-p \u003cem\u003e\u003ccode\u003eport\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--port=\u003cem\u003e\u003ccode\u003eport\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies the TCP port or local Unix domain socket file extension on which the server is listening for connections. Defaults to the \u003ccode\u003ePGPORT\u003c/code\u003e environment variable, if set, or a compiled-in default.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-U \u003cem\u003e\u003ccode\u003eusername\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--username=\u003cem\u003e\u003ccode\u003eusername\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eUser name to connect as.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-w\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--no-password\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eNever issue a password prompt. If the server requires password authentication and a password is not available by other means such as a \u003ccode\u003e.pgpass\u003c/code\u003e file, the connection attempt will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-W\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--password\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eForce \u003cspan\u003epg_dumpall\u003c/span\u003e to prompt for a password before connecting to a database.\u003c/p\u003e\n\u003cp\u003eThis option is never essential, since \u003cspan\u003epg_dumpall\u003c/span\u003e will automatically prompt for a password if the server demands password authentication. However, \u003cspan\u003epg_dumpall\u003c/span\u003e will waste a connection attempt finding out that the server wants a password. In some cases it is worth typing \u003ccode\u003e-W\u003c/code\u003e to avoid the extra connection attempt.\u003c/p\u003e\n\u003cp\u003eNote that the password prompt will occur again for each database to be dumped. Usually, it\u0026#39;s better to set up a \u003ccode\u003e~/.pgpass\u003c/code\u003e file than to rely on manual password entry.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--role=\u003cem\u003e\u003ccode\u003erolename\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies a role name to be used to create the dump. This option causes \u003cspan\u003epg_dumpall\u003c/span\u003e to issue a \u003ccode\u003eSET ROLE\u003c/code\u003e \u003cem\u003e\u003ccode\u003erolename\u003c/code\u003e\u003c/em\u003e command after connecting to the database. It is useful when the authenticated user (specified by \u003ccode\u003e-U\u003c/code\u003e) lacks privileges needed by \u003cspan\u003epg_dumpall\u003c/span\u003e, but can switch to a role with the required rights. Some installations have a policy against logging in directly as a superuser, and use of this option allows dumps to be made without violating the policy.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv id=\"id-1.9.4.15.7\"\u003e\n\u003ch2\u003eEnvironment\u003c/h2\u003e\n\u003cdiv\u003e\n\u003cdl\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003ePGHOST\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003ePGOPTIONS\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003ePGPORT\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003ePGUSER\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDefault connection parameters\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003ePG_COLOR\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies whether to use color in diagnostic messages. Possible values are \u003ccode\u003ealways\u003c/code\u003e, \u003ccode\u003eauto\u003c/code\u003e and \u003ccode\u003enever\u003c/code\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003cp\u003eThis utility, like most other \u003cspan\u003ePostgreSQL\u003c/span\u003e utilities, also uses the environment variables supported by \u003cspan\u003elibpq\u003c/span\u003e (see \u003ca href=\"/docs/18/libpq-envars.html\" rel=\"nofollow\"\u003eSection 32.15\u003c/a\u003e).\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv id=\"id-1.9.4.15.8\"\u003e\n\u003ch2\u003eNotes\u003c/h2\u003e\n\u003cp\u003eSince \u003cspan\u003epg_dumpall\u003c/span\u003e calls \u003cspan\u003epg_dump\u003c/span\u003e internally, some diagnostic messages will refer to \u003cspan\u003epg_dump\u003c/span\u003e.\u003c/p\u003e\n\u003cp\u003eThe \u003ccode\u003e--clean\u003c/code\u003e option can be useful even when your intention is to restore the dump script into a fresh cluster. Use of \u003ccode\u003e--clean\u003c/code\u003e authorizes the script to drop and re-create the built-in \u003ccode\u003epostgres\u003c/code\u003e and \u003ccode\u003etemplate1\u003c/code\u003e databases, ensuring that those databases will retain the same properties (for instance, locale and encoding) that they had in the source cluster. Without the option, those databases will retain their existing database-level properties, as well as any pre-existing contents.\u003c/p\u003e\n\u003cp\u003eWhen \u003ccode\u003e--statistics\u003c/code\u003e is specified, \u003ccode\u003epg_dumpall\u003c/code\u003e will include most optimizer statistics in the resulting dump file. This does not include all statistics, such as those created explicitly with \u003ca href=\"/docs/18/sql-createstatistics.html\" title=\"CREATE STATISTICS\" rel=\"nofollow\"\u003e\u003cspan\u003eCREATE STATISTICS\u003c/span\u003e\u003c/a\u003e, custom statistics added by an extension, or statistics collected by the cumulative statistics system. Therefore, it may still be useful to run \u003ccode\u003eANALYZE\u003c/code\u003e on each database after restoring from a dump file to ensure optimal performance. You can also run \u003ccode\u003evacuumdb -a -z\u003c/code\u003e to analyze all databases.\u003c/p\u003e\n\u003cp\u003eThe dump script should not be expected to run completely without errors. In particular, because the script will issue \u003ccode\u003eCREATE ROLE\u003c/code\u003e for every role existing in the source cluster, it is certain to get a \u003cspan\u003e“\u003cspan\u003erole already exists\u003c/span\u003e”\u003c/span\u003e error for the bootstrap superuser, unless the destination cluster was initialized with a different bootstrap superuser name. This error is harmless and should be ignored. Use of the \u003ccode\u003e--clean\u003c/code\u003e option is likely to produce additional harmless error messages about non-existent objects, although you can minimize those by adding \u003ccode\u003e--if-exists\u003c/code\u003e.\u003c/p\u003e\n\u003cp\u003e\u003cspan\u003epg_dumpall\u003c/span\u003e requires all needed tablespace directories to exist before the restore; otherwise, database creation will fail for databases in non-default locations.\u003c/p\u003e\n\u003cp\u003eIt is generally recommended to use the \u003ccode\u003e-X\u003c/code\u003e (\u003ccode\u003e--no-psqlrc\u003c/code\u003e) option when restoring a database from a \u003cspan\u003epg_dumpall\u003c/span\u003e script to ensure a clean restore process and prevent potential conflicts with non-default \u003cspan\u003epsql\u003c/span\u003e configurations. Additionally, because the \u003cspan\u003epg_dumpall\u003c/span\u003e script may include \u003cspan\u003epsql\u003c/span\u003e meta-commands, it may be incompatible with clients other than \u003cspan\u003epsql\u003c/span\u003e.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv id=\"APP-PG-DUMPALL-EX\"\u003e\n\u003ch2\u003eExamples\u003c/h2\u003e\n\u003cp\u003eTo dump all databases:\u003c/p\u003e\n\u003cpre\u003e\u003ccode\u003e$\u003c/code\u003e \u003cstrong\u003e\u003ccode\u003epg_dumpall \u0026gt; db.out\u003c/code\u003e\u003c/strong\u003e\n\u003c/pre\u003e\n\u003cp\u003eTo restore database(s) from this file, you can use:\u003c/p\u003e\n\u003cpre\u003e\u003ccode\u003e$\u003c/code\u003e \u003cstrong\u003e\u003ccode\u003epsql -X -f db.out -d postgres\u003c/code\u003e\u003c/strong\u003e\n\u003c/pre\u003e\n\u003cp\u003eIt is not important which database you connect to here since the script file created by \u003cspan\u003epg_dumpall\u003c/span\u003e will contain the appropriate commands to create and connect to the saved databases. An exception is that if you specified \u003ccode\u003e--clean\u003c/code\u003e, you must connect to the \u003ccode\u003epostgres\u003c/code\u003e database initially; the script will attempt to drop other databases immediately, and that will fail for the database you are connected to.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv id=\"id-1.9.4.15.10\"\u003e\n\u003ch2\u003eSee Also\u003c/h2\u003e\n\u003cp\u003eCheck \u003ca href=\"/docs/18/app-pgdump.html\" title=\"pg_dump\" rel=\"nofollow\"\u003e\u003cspan\u003e\u003cspan\u003epg_dump\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e for details on possible error conditions.\u003c/p\u003e\n\u003c/div\u003e\n\u003c/div\u003e\u003c/div\u003e","SourceRevision":"ee8d1a3612338fd9adf250730cb640fcc5233b5491337cc00a316a44e3a0b9f8","ContentHash":"0431e1500a448f45b9043943fc061267f0c7947009f55a931788af6ac4caea31","Payload":{"description":["pg_dumpall — extract a PostgreSQL database cluster into a script file"],"manual_html":"\u003cdiv\u003e\u003cdiv class=\"refentry\" id=\"APP-PG-DUMPALL\"\u003e\n\u003cdiv class=\"titlepage\"\u003e\u003c/div\u003e\n\u003cdiv class=\"refnamediv\"\u003e\n\u003ch2\u003e\u003cspan class=\"refentrytitle\"\u003e\u003cspan class=\"application\"\u003epg_dumpall\u003c/span\u003e\u003c/span\u003e\u003c/h2\u003e\n\u003cp\u003epg_dumpall — extract a \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e database cluster into a script file\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsynopsisdiv\"\u003e\n\u003ch2\u003eSynopsis\u003c/h2\u003e\n\u003cdiv class=\"cmdsynopsis\"\u003e\n\u003cp id=\"id-1.9.4.15.4.1\"\u003e\u003ccode class=\"command\"\u003epg_dumpall\u003c/code\u003e [\u003cem class=\"replaceable\"\u003e\u003ccode\u003econnection-option\u003c/code\u003e\u003c/em\u003e...] [\u003cem class=\"replaceable\"\u003e\u003ccode\u003eoption\u003c/code\u003e\u003c/em\u003e...]\u003c/p\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"APP-PG-DUMPALL-DESCRIPTION\"\u003e\n\u003ch2\u003eDescription\u003c/h2\u003e\n\u003cp\u003e\u003cspan class=\"application\"\u003epg_dumpall\u003c/span\u003e is a utility for writing out (\u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003edumping\u003c/span\u003e”\u003c/span\u003e) all \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e databases of a cluster into one script file. The script file contains SQL commands that can be used as input to \u003ca class=\"xref\" href=\"/docs/18/app-psql.html\" title=\"psql\"\u003e\u003cspan class=\"refentrytitle\"\u003e\u003cspan class=\"application\"\u003epsql\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e to restore the databases. It does this by calling \u003ca class=\"xref\" href=\"/docs/18/app-pgdump.html\" title=\"pg_dump\"\u003e\u003cspan class=\"refentrytitle\"\u003e\u003cspan class=\"application\"\u003epg_dump\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e for each database in the cluster. \u003cspan class=\"application\"\u003epg_dumpall\u003c/span\u003e also dumps global objects that are common to all databases, namely database roles, tablespaces, and privilege grants for configuration parameters. (\u003cspan class=\"application\"\u003epg_dump\u003c/span\u003e does not save these objects.)\u003c/p\u003e\n\u003cp\u003eSince \u003cspan class=\"application\"\u003epg_dumpall\u003c/span\u003e reads tables from all databases you will most likely have to connect as a database superuser in order to produce a complete dump. Also you will need superuser privileges to execute the saved script in order to be allowed to add roles and create databases.\u003c/p\u003e\n\u003cp\u003eThe SQL script will be written to the standard output. Use the \u003ccode class=\"option\"\u003e-f\u003c/code\u003e/\u003ccode class=\"option\"\u003e--file\u003c/code\u003e option or shell operators to redirect it into a file.\u003c/p\u003e\n\u003cp\u003e\u003cspan class=\"application\"\u003epg_dumpall\u003c/span\u003e needs to connect several times to the \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e server (once per database). If you use password authentication it will ask for a password each time. It is convenient to have a \u003ccode class=\"filename\"\u003e~/.pgpass\u003c/code\u003e file in such cases. See \u003ca class=\"xref\" href=\"/docs/18/libpq-pgpass.html\" title=\"32.16. The Password File\"\u003eSection 32.16\u003c/a\u003e for more information.\u003c/p\u003e\n\u003cdiv class=\"warning\"\u003e\n\u003ch3 class=\"title\"\u003eWarning\u003c/h3\u003e\n\u003cp\u003eRestoring a dump causes the destination to execute arbitrary code of the source superusers' choice. Partial dumps and partial restores do not limit that. If the source superusers are not trusted, the dumped SQL statements must be inspected before restoring. Note that the client running the dump and restore need not trust the source or destination superusers.\u003c/p\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.4.15.6\"\u003e\n\u003ch2\u003eOptions\u003c/h2\u003e\n\u003cp\u003eThe following command-line options control the content and format of the output.\u003c/p\u003e\n\u003cdiv class=\"variablelist\"\u003e\n\u003cdl class=\"variablelist\"\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-a\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--data-only\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDump only the data, not the schema (data definitions) or statistics.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-c\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--clean\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eEmit SQL commands to \u003ccode class=\"command\"\u003eDROP\u003c/code\u003e all the dumped databases, roles, and tablespaces before recreating them. This option is useful when the restore is to overwrite an existing cluster. If any of the objects do not exist in the destination cluster, ignorable error messages will be reported during restore, unless \u003ccode class=\"option\"\u003e--if-exists\u003c/code\u003e is also specified.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-E \u003cem class=\"replaceable\"\u003e\u003ccode\u003eencoding\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--encoding=\u003cem class=\"replaceable\"\u003e\u003ccode\u003eencoding\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eCreate the dump in the specified character set encoding. By default, the dump is created in the database encoding. (Another way to get the same result is to set the \u003ccode class=\"envar\"\u003ePGCLIENTENCODING\u003c/code\u003e environment variable to the desired dump encoding.)\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-f \u003cem class=\"replaceable\"\u003e\u003ccode\u003efilename\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--file=\u003cem class=\"replaceable\"\u003e\u003ccode\u003efilename\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSend output to the specified file. If this is omitted, the standard output is used.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-g\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--globals-only\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDump only global objects (roles and tablespaces), no databases.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-O\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--no-owner\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDo not output commands to set ownership of objects to match the original database. By default, \u003cspan class=\"application\"\u003epg_dumpall\u003c/span\u003e issues \u003ccode class=\"command\"\u003eALTER OWNER\u003c/code\u003e or \u003ccode class=\"command\"\u003eSET SESSION AUTHORIZATION\u003c/code\u003e statements to set ownership of created schema elements. These statements will fail when the script is run unless it is started by a superuser (or the same user that owns all of the objects in the script). To make a script that can be restored by any user, but will give that user ownership of all the objects, specify \u003ccode class=\"option\"\u003e-O\u003c/code\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-r\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--roles-only\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDump only roles, no databases or tablespaces.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-s\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--schema-only\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDump only the object definitions (schema), not data.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-S \u003cem class=\"replaceable\"\u003e\u003ccode\u003eusername\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--superuser=\u003cem class=\"replaceable\"\u003e\u003ccode\u003eusername\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecify the superuser user name to use when disabling triggers. This is relevant only if \u003ccode class=\"option\"\u003e--disable-triggers\u003c/code\u003e is used. (Usually, it's better to leave this out, and instead start the resulting script as superuser.)\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-t\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--tablespaces-only\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDump only tablespaces, no databases or roles.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-v\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--verbose\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies verbose mode. This will cause \u003cspan class=\"application\"\u003epg_dumpall\u003c/span\u003e to output start/stop times to the dump file, and progress messages to standard error. Repeating the option causes additional debug-level messages to appear on standard error. The option is also passed down to \u003cspan class=\"application\"\u003epg_dump\u003c/span\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-V\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--version\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint the \u003cspan class=\"application\"\u003epg_dumpall\u003c/span\u003e version and exit.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-x\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--no-privileges\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--no-acl\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrevent dumping of access privileges (grant/revoke commands).\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--binary-upgrade\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eThis option is for use by in-place upgrade utilities. Its use for other purposes is not recommended or supported. The behavior of the option may change in future releases without notice.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--column-inserts\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--attribute-inserts\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDump data as \u003ccode class=\"command\"\u003eINSERT\u003c/code\u003e commands with explicit column names (\u003ccode class=\"literal\"\u003eINSERT INTO \u003cem class=\"replaceable\"\u003e\u003ccode\u003etable\u003c/code\u003e\u003c/em\u003e (\u003cem class=\"replaceable\"\u003e\u003ccode\u003ecolumn\u003c/code\u003e\u003c/em\u003e, ...) VALUES ...\u003c/code\u003e). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non-\u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e databases.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--disable-dollar-quoting\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eThis option disables the use of dollar quoting for function bodies, and forces them to be quoted using SQL standard string syntax.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--disable-triggers\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eThis option is relevant only when creating a dump with data and without schema. It instructs \u003cspan class=\"application\"\u003epg_dumpall\u003c/span\u003e to include commands to temporarily disable triggers on the target tables while the data is restored. Use this if you have referential integrity checks or other triggers on the tables that you do not want to invoke during data restore.\u003c/p\u003e\n\u003cp\u003ePresently, the commands emitted for \u003ccode class=\"option\"\u003e--disable-triggers\u003c/code\u003e must be done as superuser. So, you should also specify a superuser name with \u003ccode class=\"option\"\u003e-S\u003c/code\u003e, or preferably be careful to start the resulting script as a superuser.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--exclude-database=\u003cem class=\"replaceable\"\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDo not dump databases whose name matches \u003cem class=\"replaceable\"\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e. Multiple patterns can be excluded by writing multiple \u003ccode class=\"option\"\u003e--exclude-database\u003c/code\u003e switches. The \u003cem class=\"replaceable\"\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e parameter is interpreted as a pattern according to the same rules used by \u003cspan class=\"application\"\u003epsql\u003c/span\u003e's \u003ccode class=\"literal\"\u003e\\d\u003c/code\u003e commands (see \u003ca class=\"xref\" href=\"/docs/18/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"\u003ePatterns\u003c/a\u003e), so multiple databases can also be excluded by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent shell wildcard expansion.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--extra-float-digits=\u003cem class=\"replaceable\"\u003e\u003ccode\u003endigits\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eUse the specified value of extra_float_digits when dumping floating-point data, instead of the maximum available precision. Routine dumps made for backup purposes should not use this option.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--filter=\u003cem class=\"replaceable\"\u003e\u003ccode\u003efilename\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecify a filename from which to read patterns for databases excluded from the dump. The patterns are interpreted according to the same rules as \u003ccode class=\"option\"\u003e--exclude-database\u003c/code\u003e. To read from \u003ccode class=\"literal\"\u003eSTDIN\u003c/code\u003e, use \u003ccode class=\"filename\"\u003e-\u003c/code\u003e as the filename. The \u003ccode class=\"option\"\u003e--filter\u003c/code\u003e option can be specified in conjunction with \u003ccode class=\"option\"\u003e--exclude-database\u003c/code\u003e for excluding databases, and can also be specified more than once for multiple filter files.\u003c/p\u003e\n\u003cp\u003eThe file lists one database pattern per row, with the following format:\u003c/p\u003e\n\u003cpre class=\"synopsis\"\u003eexclude database \u003cem class=\"replaceable\"\u003e\u003ccode\u003ePATTERN\u003c/code\u003e\u003c/em\u003e\n\u003c/pre\u003e\n\u003cp\u003eLines starting with \u003ccode class=\"literal\"\u003e#\u003c/code\u003e are considered comments and ignored. Comments can be placed after an object pattern row as well. Blank lines are also ignored. See \u003ca class=\"xref\" href=\"/docs/18/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"\u003ePatterns\u003c/a\u003e for how to perform quoting in patterns.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--if-exists\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eUse \u003ccode class=\"literal\"\u003eDROP ... IF EXISTS\u003c/code\u003e commands to drop objects in \u003ccode class=\"option\"\u003e--clean\u003c/code\u003e mode. This suppresses \u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003edoes not exist\u003c/span\u003e”\u003c/span\u003e errors that might otherwise be reported. This option is not valid unless \u003ccode class=\"option\"\u003e--clean\u003c/code\u003e is also specified.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--inserts\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDump data as \u003ccode class=\"command\"\u003eINSERT\u003c/code\u003e commands (rather than \u003ccode class=\"command\"\u003eCOPY\u003c/code\u003e). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non-\u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e databases. Note that the restore might fail altogether if you have rearranged column order. The \u003ccode class=\"option\"\u003e--column-inserts\u003c/code\u003e option is safer, though even slower.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--load-via-partition-root\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eWhen dumping data for a table partition, make the \u003ccode class=\"command\"\u003eCOPY\u003c/code\u003e or \u003ccode class=\"command\"\u003eINSERT\u003c/code\u003e statements target the root of the partitioning hierarchy that contains it, rather than the partition itself. This causes the appropriate partition to be re-determined for each row when the data is loaded. This may be useful when restoring data on a server where rows do not always fall into the same partitions as they did on the original server. That could happen, for example, if the partitioning column is of type text and the two systems have different definitions of the collation used to sort the partitioning column.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--lock-wait-timeout=\u003cem class=\"replaceable\"\u003e\u003ccode\u003etimeout\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDo not wait forever to acquire shared table locks at the beginning of the dump. Instead, fail if unable to lock a table within the specified \u003cem class=\"replaceable\"\u003e\u003ccode\u003etimeout\u003c/code\u003e\u003c/em\u003e. The timeout may be specified in any of the formats accepted by \u003ccode class=\"command\"\u003eSET statement_timeout\u003c/code\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--no-comments\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDo not dump \u003ccode class=\"command\"\u003eCOMMENT\u003c/code\u003e commands.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--no-data\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDo not dump data.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--no-policies\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDo not dump row security policies.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--no-publications\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDo not dump publications.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--no-role-passwords\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDo not dump passwords for roles. When restored, roles will have a null password, and password authentication will always fail until the password is set. Since password values aren't needed when this option is specified, the role information is read from the catalog view \u003ccode class=\"structname\"\u003epg_roles\u003c/code\u003e instead of \u003ccode class=\"structname\"\u003epg_authid\u003c/code\u003e. Therefore, this option also helps if access to \u003ccode class=\"structname\"\u003epg_authid\u003c/code\u003e is restricted by some security policy.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--no-schema\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDo not dump schema (data definitions).\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--no-security-labels\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDo not dump security labels.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--no-statistics\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDo not dump statistics. This is the default.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--no-subscriptions\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDo not dump subscriptions.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--no-sync\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eBy default, \u003ccode class=\"command\"\u003epg_dumpall\u003c/code\u003e will wait for all files to be written safely to disk. This option causes \u003ccode class=\"command\"\u003epg_dumpall\u003c/code\u003e to return without waiting, which is faster, but means that a subsequent operating system crash can leave the dump corrupt. Generally, this option is useful for testing but should not be used when dumping data from production installation.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--no-table-access-method\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDo 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.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--no-tablespaces\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDo not output commands to create tablespaces nor select tablespaces for objects. With this option, all objects will be created in whichever tablespace is the default during restore.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--no-toast-compression\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDo not output commands to set TOAST compression methods. With this option, all columns will be restored with the default compression setting.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--no-unlogged-table-data\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDo not dump the contents of unlogged tables. This option has no effect on whether or not the table definitions (schema) are dumped; it only suppresses dumping the table data.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--on-conflict-do-nothing\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eAdd \u003ccode class=\"literal\"\u003eON CONFLICT DO NOTHING\u003c/code\u003e to \u003ccode class=\"command\"\u003eINSERT\u003c/code\u003e commands. This option is not valid unless \u003ccode class=\"option\"\u003e--inserts\u003c/code\u003e or \u003ccode class=\"option\"\u003e--column-inserts\u003c/code\u003e is also specified.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--quote-all-identifiers\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eForce quoting of all identifiers. This option is recommended when dumping a database from a server whose \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e major version is different from \u003cspan class=\"application\"\u003epg_dumpall\u003c/span\u003e's, or when the output is intended to be loaded into a server of a different major version. By default, \u003cspan class=\"application\"\u003epg_dumpall\u003c/span\u003e quotes only identifiers that are reserved words in its own major version. This sometimes results in compatibility issues when dealing with servers of other versions that may have slightly different sets of reserved words. Using \u003ccode class=\"option\"\u003e--quote-all-identifiers\u003c/code\u003e prevents such issues, at the price of a harder-to-read dump script.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--restrict-key=\u003cem class=\"replaceable\"\u003e\u003ccode\u003erestrict_key\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eUse the provided string as the \u003cspan class=\"application\"\u003epsql\u003c/span\u003e \u003ccode class=\"command\"\u003e\\restrict\u003c/code\u003e key in the dump output. If no restrict key is specified, \u003cspan class=\"application\"\u003epg_dumpall\u003c/span\u003e will generate a random one as needed. Keys may contain only alphanumeric characters.\u003c/p\u003e\n\u003cp\u003eThis option is primarily intended for testing purposes and other scenarios that require repeatable output (e.g., comparing dump files). It is not recommended for general use, as a malicious server with advance knowledge of the key may be able to inject arbitrary code that will be executed on the machine that runs \u003cspan class=\"application\"\u003epsql\u003c/span\u003e with the dump output.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--rows-per-insert=\u003cem class=\"replaceable\"\u003e\u003ccode\u003enrows\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDump data as \u003ccode class=\"command\"\u003eINSERT\u003c/code\u003e commands (rather than \u003ccode class=\"command\"\u003eCOPY\u003c/code\u003e). Controls the maximum number of rows per \u003ccode class=\"command\"\u003eINSERT\u003c/code\u003e command. The value specified must be a number greater than zero. Any error during restoring will cause only rows that are part of the problematic \u003ccode class=\"command\"\u003eINSERT\u003c/code\u003e to be lost, rather than the entire table contents.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--statistics\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDump optimizer statistics.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--statistics-only\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDump only the statistics, not the schema (data definitions) or data. Optimizer statistics for tables, materialized views, foreign tables, and indexes are dumped.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--sequence-data\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eInclude sequence data in the dump. This is the default behavior except when \u003ccode class=\"option\"\u003e--no-data\u003c/code\u003e, \u003ccode class=\"option\"\u003e--schema-only\u003c/code\u003e, or \u003ccode class=\"option\"\u003e--statistics-only\u003c/code\u003e is specified.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--use-set-session-authorization\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eOutput SQL-standard \u003ccode class=\"command\"\u003eSET SESSION AUTHORIZATION\u003c/code\u003e commands instead of \u003ccode class=\"command\"\u003eALTER OWNER\u003c/code\u003e commands to determine object ownership. This makes the dump more standards compatible, but depending on the history of the objects in the dump, might not restore properly.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-?\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--help\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eShow help about \u003cspan class=\"application\"\u003epg_dumpall\u003c/span\u003e command line arguments, and exit.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003cp\u003eThe following command-line options control the database connection parameters.\u003c/p\u003e\n\u003cdiv class=\"variablelist\"\u003e\n\u003cdl class=\"variablelist\"\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-d \u003cem class=\"replaceable\"\u003e\u003ccode\u003econnstr\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--dbname=\u003cem class=\"replaceable\"\u003e\u003ccode\u003econnstr\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies parameters used to connect to the server, as a \u003ca class=\"link\" href=\"/docs/18/libpq-connect.html#LIBPQ-CONNSTRING\" title=\"32.1.1. Connection Strings\"\u003econnection string\u003c/a\u003e; these will override any conflicting command line options.\u003c/p\u003e\n\u003cp\u003eThe option is called \u003ccode class=\"literal\"\u003e--dbname\u003c/code\u003e for consistency with other client applications, but because \u003cspan class=\"application\"\u003epg_dumpall\u003c/span\u003e needs to connect to many databases, the database name in the connection string will be ignored. Use the \u003ccode class=\"literal\"\u003e-l\u003c/code\u003e option to specify the name of the database used for the initial connection, which will dump global objects and discover what other databases should be dumped.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-h \u003cem class=\"replaceable\"\u003e\u003ccode\u003ehost\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--host=\u003cem class=\"replaceable\"\u003e\u003ccode\u003ehost\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies the host name of the machine on which the database server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket. The default is taken from the \u003ccode class=\"envar\"\u003ePGHOST\u003c/code\u003e environment variable, if set, else a Unix domain socket connection is attempted.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-l \u003cem class=\"replaceable\"\u003e\u003ccode\u003edbname\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--database=\u003cem class=\"replaceable\"\u003e\u003ccode\u003edbname\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies the name of the database to connect to for dumping global objects and discovering what other databases should be dumped. If not specified, the \u003ccode class=\"literal\"\u003epostgres\u003c/code\u003e database will be used, and if that does not exist, \u003ccode class=\"literal\"\u003etemplate1\u003c/code\u003e will be used.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-p \u003cem class=\"replaceable\"\u003e\u003ccode\u003eport\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--port=\u003cem class=\"replaceable\"\u003e\u003ccode\u003eport\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies the TCP port or local Unix domain socket file extension on which the server is listening for connections. Defaults to the \u003ccode class=\"envar\"\u003ePGPORT\u003c/code\u003e environment variable, if set, or a compiled-in default.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-U \u003cem class=\"replaceable\"\u003e\u003ccode\u003eusername\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--username=\u003cem class=\"replaceable\"\u003e\u003ccode\u003eusername\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eUser name to connect as.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-w\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--no-password\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eNever issue a password prompt. If the server requires password authentication and a password is not available by other means such as a \u003ccode class=\"filename\"\u003e.pgpass\u003c/code\u003e file, the connection attempt will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-W\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--password\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eForce \u003cspan class=\"application\"\u003epg_dumpall\u003c/span\u003e to prompt for a password before connecting to a database.\u003c/p\u003e\n\u003cp\u003eThis option is never essential, since \u003cspan class=\"application\"\u003epg_dumpall\u003c/span\u003e will automatically prompt for a password if the server demands password authentication. However, \u003cspan class=\"application\"\u003epg_dumpall\u003c/span\u003e will waste a connection attempt finding out that the server wants a password. In some cases it is worth typing \u003ccode class=\"option\"\u003e-W\u003c/code\u003e to avoid the extra connection attempt.\u003c/p\u003e\n\u003cp\u003eNote that the password prompt will occur again for each database to be dumped. Usually, it's better to set up a \u003ccode class=\"filename\"\u003e~/.pgpass\u003c/code\u003e file than to rely on manual password entry.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--role=\u003cem class=\"replaceable\"\u003e\u003ccode\u003erolename\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies a role name to be used to create the dump. This option causes \u003cspan class=\"application\"\u003epg_dumpall\u003c/span\u003e to issue a \u003ccode class=\"command\"\u003eSET ROLE\u003c/code\u003e \u003cem class=\"replaceable\"\u003e\u003ccode\u003erolename\u003c/code\u003e\u003c/em\u003e command after connecting to the database. It is useful when the authenticated user (specified by \u003ccode class=\"option\"\u003e-U\u003c/code\u003e) lacks privileges needed by \u003cspan class=\"application\"\u003epg_dumpall\u003c/span\u003e, but can switch to a role with the required rights. Some installations have a policy against logging in directly as a superuser, and use of this option allows dumps to be made without violating the policy.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.4.15.7\"\u003e\n\u003ch2\u003eEnvironment\u003c/h2\u003e\n\u003cdiv class=\"variablelist\"\u003e\n\u003cdl class=\"variablelist\"\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"envar\"\u003ePGHOST\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"envar\"\u003ePGOPTIONS\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"envar\"\u003ePGPORT\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"envar\"\u003ePGUSER\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDefault connection parameters\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"envar\"\u003ePG_COLOR\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies whether to use color in diagnostic messages. Possible values are \u003ccode class=\"literal\"\u003ealways\u003c/code\u003e, \u003ccode class=\"literal\"\u003eauto\u003c/code\u003e and \u003ccode class=\"literal\"\u003enever\u003c/code\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003cp\u003eThis utility, like most other \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e utilities, also uses the environment variables supported by \u003cspan class=\"application\"\u003elibpq\u003c/span\u003e (see \u003ca class=\"xref\" href=\"/docs/18/libpq-envars.html\" title=\"32.15. Environment Variables\"\u003eSection 32.15\u003c/a\u003e).\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.4.15.8\"\u003e\n\u003ch2\u003eNotes\u003c/h2\u003e\n\u003cp\u003eSince \u003cspan class=\"application\"\u003epg_dumpall\u003c/span\u003e calls \u003cspan class=\"application\"\u003epg_dump\u003c/span\u003e internally, some diagnostic messages will refer to \u003cspan class=\"application\"\u003epg_dump\u003c/span\u003e.\u003c/p\u003e\n\u003cp\u003eThe \u003ccode class=\"option\"\u003e--clean\u003c/code\u003e option can be useful even when your intention is to restore the dump script into a fresh cluster. Use of \u003ccode class=\"option\"\u003e--clean\u003c/code\u003e authorizes the script to drop and re-create the built-in \u003ccode class=\"literal\"\u003epostgres\u003c/code\u003e and \u003ccode class=\"literal\"\u003etemplate1\u003c/code\u003e databases, ensuring that those databases will retain the same properties (for instance, locale and encoding) that they had in the source cluster. Without the option, those databases will retain their existing database-level properties, as well as any pre-existing contents.\u003c/p\u003e\n\u003cp\u003eWhen \u003ccode class=\"option\"\u003e--statistics\u003c/code\u003e is specified, \u003ccode class=\"command\"\u003epg_dumpall\u003c/code\u003e will include most optimizer statistics in the resulting dump file. This does not include all statistics, such as those created explicitly with \u003ca class=\"xref\" href=\"/docs/18/sql-createstatistics.html\" title=\"CREATE STATISTICS\"\u003e\u003cspan class=\"refentrytitle\"\u003eCREATE STATISTICS\u003c/span\u003e\u003c/a\u003e, custom statistics added by an extension, or statistics collected by the cumulative statistics system. Therefore, it may still be useful to run \u003ccode class=\"command\"\u003eANALYZE\u003c/code\u003e on each database after restoring from a dump file to ensure optimal performance. You can also run \u003ccode class=\"command\"\u003evacuumdb -a -z\u003c/code\u003e to analyze all databases.\u003c/p\u003e\n\u003cp\u003eThe dump script should not be expected to run completely without errors. In particular, because the script will issue \u003ccode class=\"command\"\u003eCREATE ROLE\u003c/code\u003e for every role existing in the source cluster, it is certain to get a \u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003erole already exists\u003c/span\u003e”\u003c/span\u003e error for the bootstrap superuser, unless the destination cluster was initialized with a different bootstrap superuser name. This error is harmless and should be ignored. Use of the \u003ccode class=\"option\"\u003e--clean\u003c/code\u003e option is likely to produce additional harmless error messages about non-existent objects, although you can minimize those by adding \u003ccode class=\"option\"\u003e--if-exists\u003c/code\u003e.\u003c/p\u003e\n\u003cp\u003e\u003cspan class=\"application\"\u003epg_dumpall\u003c/span\u003e requires all needed tablespace directories to exist before the restore; otherwise, database creation will fail for databases in non-default locations.\u003c/p\u003e\n\u003cp\u003eIt is generally recommended to use the \u003ccode class=\"option\"\u003e-X\u003c/code\u003e (\u003ccode class=\"option\"\u003e--no-psqlrc\u003c/code\u003e) option when restoring a database from a \u003cspan class=\"application\"\u003epg_dumpall\u003c/span\u003e script to ensure a clean restore process and prevent potential conflicts with non-default \u003cspan class=\"application\"\u003epsql\u003c/span\u003e configurations. Additionally, because the \u003cspan class=\"application\"\u003epg_dumpall\u003c/span\u003e script may include \u003cspan class=\"application\"\u003epsql\u003c/span\u003e meta-commands, it may be incompatible with clients other than \u003cspan class=\"application\"\u003epsql\u003c/span\u003e.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"APP-PG-DUMPALL-EX\"\u003e\n\u003ch2\u003eExamples\u003c/h2\u003e\n\u003cp\u003eTo dump all databases:\u003c/p\u003e\n\u003cpre class=\"screen\"\u003e\u003ccode class=\"prompt\"\u003e$\u003c/code\u003e \u003cstrong class=\"userinput\"\u003e\u003ccode\u003epg_dumpall \u0026gt; db.out\u003c/code\u003e\u003c/strong\u003e\n\u003c/pre\u003e\n\u003cp\u003eTo restore database(s) from this file, you can use:\u003c/p\u003e\n\u003cpre class=\"screen\"\u003e\u003ccode class=\"prompt\"\u003e$\u003c/code\u003e \u003cstrong class=\"userinput\"\u003e\u003ccode\u003epsql -X -f db.out -d postgres\u003c/code\u003e\u003c/strong\u003e\n\u003c/pre\u003e\n\u003cp\u003eIt is not important which database you connect to here since the script file created by \u003cspan class=\"application\"\u003epg_dumpall\u003c/span\u003e will contain the appropriate commands to create and connect to the saved databases. An exception is that if you specified \u003ccode class=\"option\"\u003e--clean\u003c/code\u003e, you must connect to the \u003ccode class=\"literal\"\u003epostgres\u003c/code\u003e database initially; the script will attempt to drop other databases immediately, and that will fail for the database you are connected to.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.4.15.10\"\u003e\n\u003ch2\u003eSee Also\u003c/h2\u003e\n\u003cp\u003eCheck \u003ca class=\"xref\" href=\"/docs/18/app-pgdump.html\" title=\"pg_dump\"\u003e\u003cspan class=\"refentrytitle\"\u003e\u003cspan class=\"application\"\u003epg_dump\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e for details on possible error conditions.\u003c/p\u003e\n\u003c/div\u003e\n\u003c/div\u003e\u003c/div\u003e","related":[{"label":"libpq connection parameters","url":"/wiki/conn/?v=18"}],"sections":[],"tables":[{"columns":[{"key":"signature","label":"Option and arguments"},{"key":"summary","label":"Description"}],"key":"options","rows":[{"signature":{"text":"-a --data-only","url":"/docs/18/app-pg-dumpall.html"},"summary":"Dump only the data, not the schema (data definitions) or statistics."},{"signature":{"text":"-c --clean","url":"/docs/18/app-pg-dumpall.html"},"summary":"Emit SQL commands to DROP all the dumped databases, roles, and tablespaces before recreating them. This option is useful when the restore is to overwrite an existing cluster. If any of the objects do not exist in the destination cluster, ignorable error messages will be reported during restore, unless --if-exists is also specified."},{"signature":{"text":"-E encoding --encoding= encoding","url":"/docs/18/app-pg-dumpall.html"},"summary":"Create the dump in the specified character set encoding. By default, the dump is created in the database encoding. (Another way to get the same result is to set the PGCLIENTENCODING environment variable to the desired dump encoding.)"},{"signature":{"text":"-f filename --file= filename","url":"/docs/18/app-pg-dumpall.html"},"summary":"Send output to the specified file. If this is omitted, the standard output is used."},{"signature":{"text":"-g --globals-only","url":"/docs/18/app-pg-dumpall.html"},"summary":"Dump only global objects (roles and tablespaces), no databases."},{"signature":{"text":"-O --no-owner","url":"/docs/18/app-pg-dumpall.html"},"summary":"Do not output commands to set ownership of objects to match the original database. By default, pg_dumpall issues ALTER OWNER or SET SESSION AUTHORIZATION statements to set ownership of created schema elements. These statements will fail when the script is run unless it is started by a superuser (or the same user that owns all of the objects in the script). To make a script that can be restored by any user, but will give that user ownership of all the objects, specify -O ."},{"signature":{"text":"-r --roles-only","url":"/docs/18/app-pg-dumpall.html"},"summary":"Dump only roles, no databases or tablespaces."},{"signature":{"text":"-s --schema-only","url":"/docs/18/app-pg-dumpall.html"},"summary":"Dump only the object definitions (schema), not data."},{"signature":{"text":"-S username --superuser= username","url":"/docs/18/app-pg-dumpall.html"},"summary":"Specify the superuser user name to use when disabling triggers. This is relevant only if --disable-triggers is used. (Usually, it's better to leave this out, and instead start the resulting script as superuser.)"},{"signature":{"text":"-t --tablespaces-only","url":"/docs/18/app-pg-dumpall.html"},"summary":"Dump only tablespaces, no databases or roles."},{"signature":{"text":"-v --verbose","url":"/docs/18/app-pg-dumpall.html"},"summary":"Specifies verbose mode. This will cause pg_dumpall to output start/stop times to the dump file, and progress messages to standard error. Repeating the option causes additional debug-level messages to appear on standard error. The option is also passed down to pg_dump ."},{"signature":{"text":"-V --version","url":"/docs/18/app-pg-dumpall.html"},"summary":"Print the pg_dumpall version and exit."},{"signature":{"text":"-x --no-privileges --no-acl","url":"/docs/18/app-pg-dumpall.html"},"summary":"Prevent dumping of access privileges (grant/revoke commands)."},{"signature":{"text":"--binary-upgrade","url":"/docs/18/app-pg-dumpall.html"},"summary":"This option is for use by in-place upgrade utilities. Its use for other purposes is not recommended or supported. The behavior of the option may change in future releases without notice."},{"signature":{"text":"--column-inserts --attribute-inserts","url":"/docs/18/app-pg-dumpall.html"},"summary":"Dump data as INSERT commands with explicit column names ( INSERT INTO table ( column , ...) VALUES ... ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases."},{"signature":{"text":"--disable-dollar-quoting","url":"/docs/18/app-pg-dumpall.html"},"summary":"This option disables the use of dollar quoting for function bodies, and forces them to be quoted using SQL standard string syntax."},{"signature":{"text":"--disable-triggers","url":"/docs/18/app-pg-dumpall.html"},"summary":"This option is relevant only when creating a dump with data and without schema. It instructs pg_dumpall to include commands to temporarily disable triggers on the target tables while the data is restored. Use this if you have referential integrity checks or other triggers on the tables that you do not want to invoke during data restore."},{"signature":{"text":"--exclude-database= pattern","url":"/docs/18/app-pg-dumpall.html"},"summary":"Do not dump databases whose name matches pattern . Multiple patterns can be excluded by writing multiple --exclude-database switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple databases can also be excluded by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent shell wildcard expansion."},{"signature":{"text":"--extra-float-digits= ndigits","url":"/docs/18/app-pg-dumpall.html"},"summary":"Use the specified value of extra_float_digits when dumping floating-point data, instead of the maximum available precision. Routine dumps made for backup purposes should not use this option."},{"signature":{"text":"--filter= filename","url":"/docs/18/app-pg-dumpall.html"},"summary":"Specify a filename from which to read patterns for databases excluded from the dump. The patterns are interpreted according to the same rules as --exclude-database . To read from STDIN , use - as the filename. The --filter option can be specified in conjunction with --exclude-database for excluding databases, and can also be specified more than once for multiple filter files."},{"signature":{"text":"--if-exists","url":"/docs/18/app-pg-dumpall.html"},"summary":"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 is also specified."},{"signature":{"text":"--inserts","url":"/docs/18/app-pg-dumpall.html"},"summary":"Dump data as INSERT commands (rather than COPY ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. Note that the restore might fail altogether if you have rearranged column order. The --column-inserts option is safer, though even slower."},{"signature":{"text":"--load-via-partition-root","url":"/docs/18/app-pg-dumpall.html"},"summary":"When dumping data for a table partition, make the COPY or INSERT statements target the root of the partitioning hierarchy that contains it, rather than the partition itself. This causes the appropriate partition to be re-determined for each row when the data is loaded. This may be useful when restoring data on a server where rows do not always fall into the same partitions as they did on the original server. That could happen, for example, if the partitioning column is of type text and the two systems have different definitions of the collation used to sort the partitioning column."},{"signature":{"text":"--lock-wait-timeout= timeout","url":"/docs/18/app-pg-dumpall.html"},"summary":"Do not wait forever to acquire shared table locks at the beginning of the dump. Instead, fail if unable to lock a table within the specified timeout . The timeout may be specified in any of the formats accepted by SET statement_timeout ."},{"signature":{"text":"--no-comments","url":"/docs/18/app-pg-dumpall.html"},"summary":"Do not dump COMMENT commands."},{"signature":{"text":"--no-data","url":"/docs/18/app-pg-dumpall.html"},"summary":"Do not dump data."},{"signature":{"text":"--no-policies","url":"/docs/18/app-pg-dumpall.html"},"summary":"Do not dump row security policies."},{"signature":{"text":"--no-publications","url":"/docs/18/app-pg-dumpall.html"},"summary":"Do not dump publications."},{"signature":{"text":"--no-role-passwords","url":"/docs/18/app-pg-dumpall.html"},"summary":"Do not dump passwords for roles. When restored, roles will have a null password, and password authentication will always fail until the password is set. Since password values aren't needed when this option is specified, the role information is read from the catalog view pg_roles instead of pg_authid . Therefore, this option also helps if access to pg_authid is restricted by some security policy."},{"signature":{"text":"--no-schema","url":"/docs/18/app-pg-dumpall.html"},"summary":"Do not dump schema (data definitions)."},{"signature":{"text":"--no-security-labels","url":"/docs/18/app-pg-dumpall.html"},"summary":"Do not dump security labels."},{"signature":{"text":"--no-statistics","url":"/docs/18/app-pg-dumpall.html"},"summary":"Do not dump statistics. This is the default."},{"signature":{"text":"--no-subscriptions","url":"/docs/18/app-pg-dumpall.html"},"summary":"Do not dump subscriptions."},{"signature":{"text":"--no-sync","url":"/docs/18/app-pg-dumpall.html"},"summary":"By default, pg_dumpall will wait for all files to be written safely to disk. This option causes pg_dumpall to return without waiting, which is faster, but means that a subsequent operating system crash can leave the dump corrupt. Generally, this option is useful for testing but should not be used when dumping data from production installation."},{"signature":{"text":"--no-table-access-method","url":"/docs/18/app-pg-dumpall.html"},"summary":"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."},{"signature":{"text":"--no-tablespaces","url":"/docs/18/app-pg-dumpall.html"},"summary":"Do not output commands to create tablespaces nor select tablespaces for objects. With this option, all objects will be created in whichever tablespace is the default during restore."},{"signature":{"text":"--no-toast-compression","url":"/docs/18/app-pg-dumpall.html"},"summary":"Do not output commands to set TOAST compression methods. With this option, all columns will be restored with the default compression setting."},{"signature":{"text":"--no-unlogged-table-data","url":"/docs/18/app-pg-dumpall.html"},"summary":"Do not dump the contents of unlogged tables. This option has no effect on whether or not the table definitions (schema) are dumped; it only suppresses dumping the table data."},{"signature":{"text":"--on-conflict-do-nothing","url":"/docs/18/app-pg-dumpall.html"},"summary":"Add ON CONFLICT DO NOTHING to INSERT commands. This option is not valid unless --inserts or --column-inserts is also specified."},{"signature":{"text":"--quote-all-identifiers","url":"/docs/18/app-pg-dumpall.html"},"summary":"Force quoting of all identifiers. This option is recommended when dumping a database from a server whose PostgreSQL major version is different from pg_dumpall 's, or when the output is intended to be loaded into a server of a different major version. By default, pg_dumpall quotes only identifiers that are reserved words in its own major version. This sometimes results in compatibility issues when dealing with servers of other versions that may have slightly different sets of reserved words. Using --quote-all-identifiers prevents such issues, at the price of a harder-to-read dump script."},{"signature":{"text":"--restrict-key= restrict_key","url":"/docs/18/app-pg-dumpall.html"},"summary":"Use the provided string as the psql \\restrict key in the dump output. If no restrict key is specified, pg_dumpall will generate a random one as needed. Keys may contain only alphanumeric characters."},{"signature":{"text":"--rows-per-insert= nrows","url":"/docs/18/app-pg-dumpall.html"},"summary":"Dump data as INSERT commands (rather than COPY ). Controls the maximum number of rows per INSERT command. The value specified must be a number greater than zero. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents."},{"signature":{"text":"--statistics","url":"/docs/18/app-pg-dumpall.html"},"summary":"Dump optimizer statistics."},{"signature":{"text":"--statistics-only","url":"/docs/18/app-pg-dumpall.html"},"summary":"Dump only the statistics, not the schema (data definitions) or data. Optimizer statistics for tables, materialized views, foreign tables, and indexes are dumped."},{"signature":{"text":"--sequence-data","url":"/docs/18/app-pg-dumpall.html"},"summary":"Include sequence data in the dump. This is the default behavior except when --no-data , --schema-only , or --statistics-only is specified."},{"signature":{"text":"--use-set-session-authorization","url":"/docs/18/app-pg-dumpall.html"},"summary":"Output SQL-standard SET SESSION AUTHORIZATION commands instead of ALTER OWNER commands to determine object ownership. This makes the dump more standards compatible, but depending on the history of the objects in the dump, might not restore properly."},{"signature":{"text":"-? --help","url":"/docs/18/app-pg-dumpall.html"},"summary":"Show help about pg_dumpall command line arguments, and exit."},{"signature":{"text":"-d connstr --dbname= connstr","url":"/docs/18/app-pg-dumpall.html"},"summary":"Specifies parameters used to connect to the server, as a connection string ; these will override any conflicting command line options."},{"signature":{"text":"-h host --host= host","url":"/docs/18/app-pg-dumpall.html"},"summary":"Specifies the host name of the machine on which the database server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket. The default is taken from the PGHOST environment variable, if set, else a Unix domain socket connection is attempted."},{"signature":{"text":"-l dbname --database= dbname","url":"/docs/18/app-pg-dumpall.html"},"summary":"Specifies the name of the database to connect to for dumping global objects and discovering what other databases should be dumped. If not specified, the postgres database will be used, and if that does not exist, template1 will be used."},{"signature":{"text":"-p port --port= port","url":"/docs/18/app-pg-dumpall.html"},"summary":"Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections. Defaults to the PGPORT environment variable, if set, or a compiled-in default."},{"signature":{"text":"-U username --username= username","url":"/docs/18/app-pg-dumpall.html"},"summary":"User name to connect as."},{"signature":{"text":"-w --no-password","url":"/docs/18/app-pg-dumpall.html"},"summary":"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 will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password."},{"signature":{"text":"-W --password","url":"/docs/18/app-pg-dumpall.html"},"summary":"Force pg_dumpall to prompt for a password before connecting to a database."},{"signature":{"text":"--role= rolename","url":"/docs/18/app-pg-dumpall.html"},"summary":"Specifies a role name to be used to create the dump. This option causes pg_dumpall to issue a SET ROLE rolename command after connecting to the database. It is useful when the authenticated user (specified by -U ) lacks privileges needed by pg_dumpall , but can switch to a role with the required rights. Some installations have a policy against logging in directly as a superuser, and use of this option allows dumps to be made without violating the policy."}],"title":"Documented options"},{"columns":[{"key":"name","label":"Variable"},{"key":"description","label":"Meaning"}],"key":"environment","rows":[{"description":"Default connection parameters","name":"PGHOST PGOPTIONS PGPORT PGUSER"},{"description":"Specifies whether to use color in diagnostic messages. Possible values are always , auto and never .","name":"PG_COLOR"}],"title":"Environment variables"}]}},"RequestedLocale":"zh-Hans","Fallback":true,"Versions":["10","11","12","13","14","15","16","17","18","19","20"],"Locales":["en"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
