From e4f432aa48ff3995192ca4101d96eef22757379d Mon Sep 17 00:00:00 2001 From: taomaolou Date: Wed, 18 Nov 2026 00:47:08 +0800 Subject: [PATCH 1/2] docs(en): add missing v5.6 pg_dumpall CLI options --- EN/modules/ROOT/pages/9.adoc | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/EN/modules/ROOT/pages/9.adoc b/EN/modules/ROOT/pages/9.adoc index d4b420c6..0dc8d869 100644 --- a/EN/modules/ROOT/pages/9.adoc +++ b/EN/modules/ROOT/pages/9.adoc @@ -1910,6 +1910,10 @@ Do not dump databases whose name matches *`pattern`*. Multiple patterns can be e 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. +- `--filter=*`filename`*` + +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. Each line in the file lists one database pattern in the format `exclude database *PATTERN*`. Lines starting with `#` are considered comments and ignored (comments can be placed after an object pattern row as well), and blank lines are also ignored. + - `--if-exists` Use conditional commands (i.e., add an `IF EXISTS` clause) to drop databases and other objects. This option is not valid unless `--clean` is also specified. @@ -1930,6 +1934,14 @@ Do not wait forever to acquire shared table locks at the beginning of the dump. Do not dump comments. +- `--no-data` + +Do not dump data. + +- `--no-policies` + +Do not dump row security policies. + - `--no-publications` Do not dump publications. @@ -1938,10 +1950,18 @@ Do not dump publications. 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. +- `--no-schema` + +Do not dump schema (data definitions). + - `--no-security-labels` Do not dump security labels. +- `--no-statistics` + +Do not dump statistics. This is the default. + - `--no-subscriptions` Do not dump subscriptions. @@ -1974,10 +1994,26 @@ Add `ON CONFLICT DO NOTHING` to `INSERT` commands. This option is not valid unle Force quoting of all identifiers. This option is recommended when dumping a database from a server whose IvorySQL 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. +- `--restrict-key=*`restrict_key`*` + +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. + - `--rows-per-insert=*`nrows`*` 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. +- `--statistics` + +Dump optimizer statistics. + +- `--statistics-only` + +Dump only the statistics, not the schema (data definitions) or data. Optimizer statistics for tables, materialized views, foreign tables, and indexes are dumped. + +- `--sequence-data` + +Include sequence data in the dump. This is the default behavior except when `--no-data`, `--schema-only`, or `--statistics-only` is specified. + - `--use-set-session-authorization` 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. From 5122dca527d33a39e25d4c8e6c5a27ef306180f5 Mon Sep 17 00:00:00 2001 From: taomaolou Date: Wed, 18 Nov 2026 00:48:23 +0800 Subject: [PATCH 2/2] docs(cn): add missing v5.6 pg_dumpall CLI options --- CN/modules/ROOT/pages/9.adoc | 42 +++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/CN/modules/ROOT/pages/9.adoc b/CN/modules/ROOT/pages/9.adoc index 2432ee47..42e2cf38 100644 --- a/CN/modules/ROOT/pages/9.adoc +++ b/CN/modules/ROOT/pages/9.adoc @@ -1926,6 +1926,10 @@ pg_dumpall需要多次连接到IvorySQL服务器(每个数据库一次)。 在转储浮点数据时使用extra_float_digits规定的值,而不是最大可用精度。备份目的进行的常规转储不使用此选项。 +- `--filter=*filename*` + +指定一个文件名,从中读取要从转储中排除的数据库模式。这些模式的解释规则与 `--exclude-database` 相同。要从 `STDIN` 读取,请使用 `-` 作为文件名。`--filter` 选项可以与 `--exclude-database` 一起指定以排除数据库,也可以多次指定以使用多个过滤文件。文件中的每一行列出一个数据库模式,格式为 `exclude database *PATTERN*`。以 `#` 开头的行被视为注释并被忽略(也可以在对象模式行之后添加注释),空行也会被忽略。 + - `--if-exists` 时间条件性命令(即增加一个 `IF EXISTS` 子句)来清除数据库和其他对象。 只有同时指定了 `--clean` 时,这个选项才可用。 @@ -1946,6 +1950,14 @@ pg_dumpall需要多次连接到IvorySQL服务器(每个数据库一次)。 不转储注释。 +- `--no-data` + +不转储数据。 + +- `--no-policies` + +不转储行级安全策略。 + - `--no-publications` 不转储publication。 @@ -1954,10 +1966,18 @@ pg_dumpall需要多次连接到IvorySQL服务器(每个数据库一次)。 不为角色转储口令。在恢复完后,角色的口令将是空口令,并且在设置口令之前口令认证都不会成功。由于指定这个选项时并不需要口令值,角色信息将从目录视图 `pg_roles` 而不是 `pg_authid` 中读出。因此,如果对 `pg_authid` 的访问被某条安全性策略所限制,那么这个选项也会有所帮助。 +- `--no-schema` + +不转储模式(数据定义)。 + - `--no-security-labels` 不转储安全标签。 +- `--no-statistics` + +不转储统计信息。这是默认行为。 + - `--no-subscriptions` 不转储subscription。 @@ -1966,11 +1986,15 @@ pg_dumpall需要多次连接到IvorySQL服务器(每个数据库一次)。 默认情况下,`pg_dumpall` 将等待所有文件被安全地写入到磁盘。这个选项会让 `pg_dumpall` 不做这种等待而返回,这样会更快,但是意味着后续的操作系统崩溃可能留下被损坏的转储。通常来说,这个选项对测试有用,但不应该在从生产安装中转储数据时使用。 +- `--no-table-access-method` + +不输出用于选择表访问方法的命令。使用此选项时,所有对象都将使用恢复期间的默认表访问方法创建。 + - `--no-tablespaces` 不要输出选择表空间的命令。通过这个选项,在恢复期间所有的对象都会被创建在任何作为默认的表空间中。 -- `-−no-toast-compression` +- `--no-toast-compression` 不要输出命令以设置 TOAST 压缩方法。 采用这个选项,所有列将会以默认压缩设置来恢复。 @@ -1986,10 +2010,26 @@ pg_dumpall需要多次连接到IvorySQL服务器(每个数据库一次)。 强制引用所有标识符。在从一个与pg_dumpall主版本不同的IvorySQL服务器转储数据库时或者要将输出载入到一个不同主版本的服务器时,推荐使用这个选项。默认情况下,pg_dumpall只会对为其主版本中保留词的标识符加上引号。在与其他版本的具有不同保留词集合的服务器交互时,这有时会导致兼容性问题。使用 `--quote-all-identifiers` 可以阻止这类问题,但是代价是转储脚本会更加难读。 +- `--restrict-key=*restrict_key*` + +在转储输出中使用提供的字符串作为 `psql` 的 `\restrict` 密钥。如果未指定 restrict key,`pg_dumpall` 将在需要时随机生成一个。密钥只能包含字母数字字符。此选项主要用于测试以及需要可重复输出的其他场景(例如比较转储文件)。不建议在常规使用中使用该选项,因为提前知道密钥的恶意服务器可能会注入任意代码,并在使用该转储输出运行 `psql` 的机器上执行。 + - `--rows-per-insert=*nrows*` 将数据转储为 `INSERT` 命令(而不是 `COPY` )。控制每个 `INSERT` 命令的最大行数。 指定的值必须是大于零的数。重新加载期间的任何错误都将导致仅丢失有问题的 `INSERT` 的行,而不是整个表内容。 +- `--statistics` + +转储优化器统计信息。 + +- `--statistics-only` + +仅转储统计信息,而不转储模式(数据定义)或数据。将转储表、物化视图、外部表和索引的优化器统计信息。 + +- `--sequence-data` + +在转储中包含序列数据。这是默认行为,除非指定了 `--no-data`、`--schema-only` 或 `--statistics-only`。 + - `--use-set-session-authorization` 输出 SQL-标准的 `SET SESSION AUTHORIZATION` 命令取代 `ALTER OWNER` 命令来确定对象的所有关系。这让该转储更加兼容标准,但是取决于该转储中对象的历史,该转储可能无法正常恢复。