pg_amcheck
pg_amcheck — 检查一个或多个 PostgreSQL 数据库中的损坏情况
当前查看 PostgreSQL 18.6。
说明
pg_amcheck — 检查一个或多个 PostgreSQL 数据库中的损坏情况
- 手册中的可执行程序
- pg_amcheck
- 程序版本
- 18.6
- 参考清单
- 客户端程序
- 选项定义组
- 36
用法
pg_amcheck [ option ...] [ dbname ]手册中的选项
| 选项与参数 | 说明 |
|---|---|
| -a --all | 检查所有数据库,但通过 --exclude-database 排除的除外。 |
| -d pattern --database= pattern | 检查匹配指定 pattern 的数据库,但通过 --exclude-database 排除的除外。此选项可指定多次。 |
| -D pattern --exclude-database= pattern | 排除匹配指定 pattern 的数据库。此选项可指定多次。 |
| -i pattern --index= pattern | 检查匹配指定 pattern 的索引,除非另有排除。此选项可指定多次。 |
| -I pattern --exclude-index= pattern | 排除匹配指定 pattern 的索引。此选项可指定多次。 |
| -r pattern --relation= pattern | 检查匹配指定 pattern 的关系,除非另有排除。此选项可指定多次。 |
| -R pattern --exclude-relation= pattern | 排除匹配指定 pattern 的关系。此选项可指定多次。 |
| -s pattern --schema= pattern | 检查匹配指定 pattern 的模式中的表和索引,除非另有排除。此选项可指定多次。 |
| -S pattern --exclude-schema= pattern | 排除匹配指定 pattern 的模式中的表和索引。此选项可指定多次。 |
| -t pattern --table= pattern | 检查匹配指定 pattern 的表,除非另有排除。此选项可指定多次。 |
| -T pattern --exclude-table= pattern | 排除匹配指定 pattern 的表。此选项可指定多次。 |
| --no-dependent-indexes | 默认情况下,如果检查某个表,则该表上的任何 B-树索引也会一并检查,即使它们没有通过 --index 或 --relation 等选项显式选中。此选项会禁止这种行为。 |
| --no-dependent-toast | 默认情况下,如果检查某个表,则它的 TOAST 表(如果有)也会一并检查,即使该 TOAST 表没有通过 --table 或 --relation 等选项显式选中。此选项会禁止这种行为。 |
| --no-strict-names | 默认情况下,如果 --database 、 --table 、 --index 或 --relation 的某个参数没有匹配到任何对象,就会报致命错误。此选项会将该错误降级为警告。 |
| --exclude-toast-pointers | 默认情况下,只要在表中遇到 TOAST 指针,就会执行查找,以确保它引用的是 TOAST 表中表面看来有效的条目。这些检查可能相当慢,可用此选项跳过。 |
| --on-error-stop | 在某个表中发现损坏后,在报告完该表第一个损坏页面上的全部损坏后,停止处理该表关系并转到下一个表或索引。 |
| --skip= option | 如果给定 all-frozen ,表损坏检查会跳过所有表中标记为全冻结的页面。 |
| --startblock= block | 从指定块号开始检查。如果被检查的表关系块数少于这个数字,将发生错误。此选项不适用于索引,而且大概只在检查单个表关系时才有用。进一步的注意事项见 --endblock 。 |
| --endblock= block | 在指定块号结束检查。如果被检查的表关系块数少于这个数字,将发生错误。此选项不适用于索引,而且大概只在检查单个表关系时才有用。如果同时检查普通表和 TOAST 表,此选项会同时作用于两者;但在验证 TOAST 指针时,仍可能访问更高编号的 TOAST 块,除非使用 --exclude-toast-pointers 抑制这一行为。 |
| --checkunique | 对于检查的每个带唯一约束的索引,使用 amcheck 的 checkunique 选项,验证重复条目中在索引里可见的项不超过一个。 |
| --heapallindexed | 对于检查的每个索引,使用 amcheck 的 heapallindexed 选项,验证所有堆元组都以索引元组的形式出现在该索引中。 |
| --parent-check | 对于检查的每个 B-树索引,使用 amcheck 的 bt_index_parent_check 函数,该函数会在索引检查期间额外检查父子关系。 |
| --rootdescend | 对于检查的每个索引,使用 amcheck 的 rootdescend 选项,为每个元组从根页重新执行一次搜索,从而在叶级重新找到这些元组。 |
| -h hostname --host= hostname | 指定服务器所在机器的主机名。如果该值以斜杠开头,则将其用作 Unix 域套接字所在的目录。 |
| -p port --port= port | 指定服务器监听连接的 TCP 端口或本地 Unix 域套接字文件扩展名。 |
| -U --username= username | 连接时使用的用户名。 |
| -w --no-password | 永不发出密码提示。如果服务器要求密码认证,而又无法通过其他方式获取密码,例如通过 .pgpass 文件,则连接尝试会失败。此选项可用于没有用户在场输入密码的批处理作业和脚本。 |
| -W --password | 强制 pg_amcheck 在连接数据库前提示输入密码。 |
| --maintenance-db= dbname | 指定一个数据库或 连接字符串 ,用于确定待检查的数据库列表。如果既未使用 --all ,也未使用任何包含数据库名称匹配模式的选项,则不需要这样的连接,此选项也不起作用。否则,此选项值中除数据库名之外的任何连接字符串参数,在连接待检查的数据库时也会一并使用。如果省略此选项,默认值为 postgres ;若失败,则为 template1 。 |
| -e --echo | 将发送到服务器的所有 SQL 回显到标准输出。 |
| -j num --jobs= num | 使用 num 个到服务器的并发连接,或者为每个待检查对象使用一个连接,以较小者为准。 |
| -P --progress | 显示进度信息。进度信息包括已完成检查的关系数量及其总大小,也包括最终将要检查的关系总数及这些关系的估计大小。 |
| -v --verbose | 打印更多消息。特别是,它会为每个正在检查的关系打印一条消息,并提高服务器错误显示的详细程度。 |
| -V --version | 打印 pg_amcheck 版本并退出。 |
| --install-missing --install-missing= schema | 安装检查数据库所需的任何缺失扩展。如果某个扩展尚未安装,则其对象将安装到给定的 schema 中;如果未指定,则安装到 pg_catalog 模式中。 |
| -? --help | 显示 pg_amcheck 命令行参数的帮助并退出。 |
手册定义
pg_amcheck
pg_amcheck — 检查一个或多个PostgreSQL数据库中的损坏情况
大纲
pg_amcheck [option...] [dbname]
说明
pg_amcheck支持针对一个或多个数据库运行amcheck的损坏检查函数,并提供选项来选择要检查哪些模式、表和索引,执行哪些检查,以及是否并行执行这些检查;如果并行执行,还可指定要建立并使用的并行连接数。
当前仅支持普通表关系、TOAST 表关系、物化视图、序列以及 B-树索引。其他关系类型会被静默跳过。
如果指定了dbname,它应是要检查的单个数据库的名称,并且不应再出现其他数据库选择选项。否则,如果存在任何数据库选择选项,就会检查所有匹配的数据库。如果不存在这类选项,则检查默认数据库。数据库选择选项包括--all、--database和--exclude-database。它们还包括--relation、--exclude-relation、--table、--exclude-table、--index和--exclude-index,但仅限于这些选项与三部分模式一起使用时(例如 mydb*.myschema*.myrel*)。最后,当--schema和--exclude-schema与两部分模式一起使用时(例如 mydb*.myschema*),它们也属于数据库选择选项。
dbname也可以是连接字符串。
选项
下列命令行选项控制要检查的内容:
-a--all-
检查所有数据库,但通过
--exclude-database排除的除外。 -dpattern--database=pattern-
检查匹配指定
pattern的数据库,但通过--exclude-database排除的除外。此选项可指定多次。 -Dpattern--exclude-database=pattern-
排除匹配指定
pattern的数据库。此选项可指定多次。 -ipattern--index=pattern-
检查匹配指定
pattern的索引,除非另有排除。此选项可指定多次。这与
--relation选项类似,但它只适用于索引,不适用于其他关系类型。 -Ipattern--exclude-index=pattern-
排除匹配指定
pattern的索引。此选项可指定多次。这与
--exclude-relation选项类似,但它只适用于索引,不适用于其他关系类型。 -rpattern--relation=pattern-
检查匹配指定
pattern的关系,除非另有排除。此选项可指定多次。匹配模式可以是未经限定的,例如
myrel*;也可以是模式限定的,例如myschema*.myrel*;或者同时带数据库限定和模式限定,例如mydb*.myschema*.myrel*。数据库限定的模式会把匹配的数据库加入待检查数据库列表。 -Rpattern--exclude-relation=pattern-
排除匹配指定
pattern的关系。此选项可指定多次。与
--relation一样,pattern可以是未经限定的、模式限定的,或者同时带数据库限定和模式限定的。 -spattern--schema=pattern-
检查匹配指定
pattern的模式中的表和索引,除非另有排除。此选项可指定多次。若只想选择名称匹配特定模式的那些模式中的表,可考虑使用类似
--table=SCHEMAPAT.* --no-dependent-indexes的写法。若只想选择索引,可考虑使用类似--index=SCHEMAPAT.*的写法。模式名匹配模式可以带有数据库限定。例如,可以使用 --schema=mydb*.myschema*,选择名称匹配 mydb* 的数据库中名称匹配 myschema* 的模式。
-Spattern--exclude-schema=pattern-
排除匹配指定
pattern的模式中的表和索引。此选项可指定多次。与
--schema一样,该模式可以带数据库限定。 -tpattern--table=pattern-
检查匹配指定
pattern的表,除非另有排除。此选项可指定多次。这与
--relation选项类似,但它只适用于表、物化视图和序列,不适用于索引。 -Tpattern--exclude-table=pattern-
排除匹配指定
pattern的表。此选项可指定多次。这与
--exclude-relation选项类似,但它只适用于表、物化视图和序列,不适用于索引。 --no-dependent-indexes-
默认情况下,如果检查某个表,则该表上的任何 B-树索引也会一并检查,即使它们没有通过
--index或--relation等选项显式选中。此选项会禁止这种行为。 --no-dependent-toast-
默认情况下,如果检查某个表,则它的 TOAST 表(如果有)也会一并检查,即使该 TOAST 表没有通过
--table或--relation等选项显式选中。此选项会禁止这种行为。 --no-strict-names-
默认情况下,如果
--database、--table、--index或--relation的某个参数没有匹配到任何对象,就会报致命错误。此选项会将该错误降级为警告。
下列命令行选项控制表的检查:
--exclude-toast-pointers-
默认情况下,只要在表中遇到 TOAST 指针,就会执行查找,以确保它引用的是 TOAST 表中表面看来有效的条目。这些检查可能相当慢,可用此选项跳过。
--on-error-stop-
在某个表中发现损坏后,在报告完该表第一个损坏页面上的全部损坏后,停止处理该表关系并转到下一个表或索引。
注意,索引检查总是在第一个损坏页后停止。此选项只对表关系有意义。
--skip=option-
如果给定
all-frozen,表损坏检查会跳过所有表中标记为全冻结的页面。如果给定
all-visible,表损坏检查会跳过所有表中标记为全可见的页面。默认不跳过任何页面。这可以显式指定为
none,但因为这是默认值,通常无需写出。 --startblock=block-
从指定块号开始检查。如果被检查的表关系块数少于这个数字,将发生错误。此选项不适用于索引,而且大概只在检查单个表关系时才有用。进一步的注意事项见
--endblock。 --endblock=block-
在指定块号结束检查。如果被检查的表关系块数少于这个数字,将发生错误。此选项不适用于索引,而且大概只在检查单个表关系时才有用。如果同时检查普通表和 TOAST 表,此选项会同时作用于两者;但在验证 TOAST 指针时,仍可能访问更高编号的 TOAST 块,除非使用
--exclude-toast-pointers抑制这一行为。
下列命令行选项控制 B-树索引的检查:
--checkunique-
对于检查的每个带唯一约束的索引,使用amcheck的
checkunique选项,验证重复条目中在索引里可见的项不超过一个。 --heapallindexed-
对于检查的每个索引,使用amcheck的
heapallindexed选项,验证所有堆元组都以索引元组的形式出现在该索引中。 --parent-check-
对于检查的每个 B-树索引,使用amcheck的
bt_index_parent_check函数,该函数会在索引检查期间额外检查父子关系。默认使用amcheck的
bt_index_check函数,但请注意,使用--rootdescend选项会隐式选择bt_index_parent_check。 --rootdescend-
对于检查的每个索引,使用amcheck的
rootdescend选项,为每个元组从根页重新执行一次搜索,从而在叶级重新找到这些元组。使用此选项也会隐式选择
--parent-check选项。这种验证形式最初是为协助开发 B-树索引特性而编写的。它在帮助检测实际发生的那类损坏方面可能用途有限,甚至毫无帮助。它还可能使损坏检查耗时显著增加,并显著增加服务器上的资源消耗。
警告
当指定--parent-check或--rootdescend时,对 B-树索引执行的额外检查需要相对较强的关系级锁。这些检查也是唯一会阻塞INSERT、UPDATE和DELETE命令并发修改数据的检查。
下列命令行选项控制与服务器的连接:
-hhostname--host=hostname-
指定服务器所在机器的主机名。如果该值以斜杠开头,则将其用作 Unix 域套接字所在的目录。
-pport--port=port-
指定服务器监听连接的 TCP 端口或本地 Unix 域套接字文件扩展名。
-U--username=username-
连接时使用的用户名。
-w--no-password-
永不发出密码提示。如果服务器要求密码认证,而又无法通过其他方式获取密码,例如通过
.pgpass文件,则连接尝试会失败。此选项可用于没有用户在场输入密码的批处理作业和脚本。 -W--password-
强制pg_amcheck在连接数据库前提示输入密码。
该选项并非必需,因为如果服务器要求密码认证,pg_amcheck会自动提示输入密码。不过,pg_amcheck会先浪费一次连接尝试,才能发现服务器需要密码。在某些场景下,值得显式指定
-W,以避免这次额外的连接尝试。 --maintenance-db=dbname-
指定一个数据库或连接字符串,用于确定待检查的数据库列表。如果既未使用
--all,也未使用任何包含数据库名称匹配模式的选项,则不需要这样的连接,此选项也不起作用。否则,此选项值中除数据库名之外的任何连接字符串参数,在连接待检查的数据库时也会一并使用。如果省略此选项,默认值为postgres;若失败,则为template1。
还提供下列其他选项:
-e--echo-
将发送到服务器的所有 SQL 回显到标准输出。
-jnum--jobs=num-
使用
num个到服务器的并发连接,或者为每个待检查对象使用一个连接,以较小者为准。默认使用单个连接。
-P--progress-
显示进度信息。进度信息包括已完成检查的关系数量及其总大小,也包括最终将要检查的关系总数及这些关系的估计大小。
-v--verbose-
打印更多消息。特别是,它会为每个正在检查的关系打印一条消息,并提高服务器错误显示的详细程度。
-V--version-
打印pg_amcheck版本并退出。
--install-missing--install-missing=schema-
安装检查数据库所需的任何缺失扩展。如果某个扩展尚未安装,则其对象将安装到给定的
schema中;如果未指定,则安装到pg_catalog模式中。目前,唯一必需的扩展是amcheck。
-?--help-
显示pg_amcheck命令行参数的帮助并退出。
环境
与大多数其他PostgreSQL工具一样,pg_amcheck也使用libpq支持的环境变量(见第 32.15 节)。
环境变量PG_COLOR指定是否在诊断消息中使用颜色。可能的值为always、auto和never。
注解
pg_amcheck旨在与PostgreSQL 14.0 及以后版本配合使用。
另见
amcheck文档与源码
来源构建
- 版本
- 18.6
- 构建
- https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2
- 来源指纹
ee8d1a3612338fd9adf250730cb640fcc5233b5491337cc00a316a44e3a0b9f8
版本比较
PostgreSQL 13 → 14: 新增收录。
以下差异保留原始字段名与英文源描述。
--- PostgreSQL 13
+++ PostgreSQL 14
@@ -1 +1,276 @@
-该版未收录
+{
+ "environment": [],
+ "options": [
+ {
+ "description": "Check all databases, except for any excluded via --exclude-database .",
+ "names": [
+ "-a",
+ "--all"
+ ],
+ "signature": "-a --all"
+ },
+ {
+ "description": "Check databases matching the specified pattern , except for any excluded by --exclude-database . This option can be specified more than once.",
+ "names": [
+ "-d pattern",
+ "--database= pattern"
+ ],
+ "signature": "-d pattern --database= pattern"
+ },
+ {
+ "description": "Exclude databases matching the given pattern . This option can be specified more than once.",
+ "names": [
+ "-D pattern",
+ "--exclude-database= pattern"
+ ],
+ "signature": "-D pattern --exclude-database= pattern"
+ },
+ {
+ "description": "Check indexes matching the specified pattern , unless they are otherwise excluded. This option can be specified more than once. This is similar to the --relation option, except that it applies only to indexes, not tables.",
+ "names": [
+ "-i pattern",
+ "--index= pattern"
+ ],
+ "signature": "-i pattern --index= pattern"
+ },
+ {
+ "description": "Exclude indexes matching the specified pattern . This option can be specified more than once. This is similar to the --exclude-relation option, except that it applies only to indexes, not tables.",
+ "names": [
+ "-I pattern",
+ "--exclude-index= pattern"
+ ],
+ "signature": "-I pattern --exclude-index= pattern"
+ },
+ {
+ "description": "Check relations matching the specified pattern , unless they are otherwise excluded. This option can be specified more than once. Patterns may be unqualified, e.g. myrel* , or they may be schema-qualified, e.g. myschema*.myrel* or database-qualified and schema-qualified, e.g. mydb*.myschema*.myrel* . A database-qualified pattern will add matching databases to the list of databases to be checked.",
+ "names": [
+ "-r pattern",
+ "--relation= pattern"
+ ],
+ "signature": "-r pattern --relation= pattern"
+ },
+ {
+ "description": "Exclude relations matching the specified pattern . This option can be specified more than once. As with --relation , the pattern may be unqualified, schema-qualified, or database- and schema-qualified.",
+ "names": [
+ "-R pattern",
+ "--exclude-relation= pattern"
+ ],
+ "signature": "-R pattern --exclude-relation= pattern"
+ },
+ {
+ "description": "Check tables and indexes in schemas matching the specified pattern , unless they are otherwise excluded. This option can be specified more than once. To select only tables in schemas matching a particular pattern, consider using something like --table=SCHEMAPAT.* --no-dependent-indexes . To select only indexes, consider using something like --index=SCHEMAPAT.* . A schema pattern may be database-qualified. For example, you may write --schema=mydb*.myschema* to select schemas matching myschema* in databases matching mydb* .",
+ "names": [
+ "-s pattern",
+ "--schema= pattern"
+ ],
+ "signature": "-s pattern --schema= pattern"
+ },
+ {
+ "description": "Exclude tables and indexes in schemas matching the specified pattern . This option can be specified more than once. As with --schema , the pattern may be database-qualified.",
+ "names": [
+ "-S pattern",
+ "--exclude-schema= pattern"
+ ],
+ "signature": "-S pattern --exclude-schema= pattern"
+ },
+ {
+ "description": "Check tables matching the specified pattern , unless they are otherwise excluded. This option can be specified more than once. This is similar to the --relation option, except that it applies only to tables, not indexes.",
+ "names": [
+ "-t pattern",
+ "--table= pattern"
+ ],
+ "signature": "-t pattern --table= pattern"
+ },
+ {
+ "description": "Exclude tables matching the specified pattern . This option can be specified more than once. This is similar to the --exclude-relation option, except that it applies only to tables, not indexes.",
+ "names": [
+ "-T pattern",
+ "--exclude-table= pattern"
+ ],
+ "signature": "-T pattern --exclude-table= pattern"
+ },
+ {
+ "description": "By default, if a table is checked, any btree indexes of that table will also be checked, even if they are not explicitly selected by an option such as --index or --relation . This option suppresses that behavior.",
+ "names": [
+ "--no-dependent-indexes"
+ ],
+ "signature": "--no-dependent-indexes"
+ },
+ {
+ "description": "By default, if a table is checked, its toast table, if any, will also be checked, even if it is not explicitly selected by an option such as --table or --relation . This option suppresses that behavior.",
+ "names": [
+ "--no-dependent-toast"
+ ],
+ "signature": "--no-dependent-toast"
+ },
+ {
+ "description": "By default, if an argument to --database , --table , --index , or --relation matches no objects, it is a fatal error. This option downgrades that error to a warning.",
+ "names": [
+ "--no-strict-names"
+ ],
+ "signature": "--no-strict-names"
+ },
+ {
+ "description": "By default, whenever a toast pointer is encountered in a table, a lookup is performed to ensure that it references apparently-valid entries in the toast table. These checks can be quite slow, and this option can be used to skip them.",
+ "names": [
+ "--exclude-toast-pointers"
+ ],
+ "signature": "--exclude-toast-pointers"
+ },
+ {
+ "description": "After reporting all corruptions on the first page of a table where corruption is found, stop processing that table relation and move on to the next table or index. Note that index checking always stops after the first corrupt page. This option only has meaning relative to table relations.",
+ "names": [
+ "--on-error-stop"
+ ],
+ "signature": "--on-error-stop"
+ },
+ {
+ "description": "If all-frozen is given, table corruption checks will skip over pages in all tables that are marked as all frozen. If all-visible is given, table corruption checks will skip over pages in all tables that are marked as all visible. By default, no pages are skipped. This can be specified as none , but since this is the default, it need not be mentioned.",
+ "names": [
+ "--skip= option"
+ ],
+ "signature": "--skip= option"
+ },
+ {
+ "description": "Start checking at the specified block number. An error will occur if the table relation being checked has fewer than this number of blocks. This option does not apply to indexes, and is probably only useful when checking a single table relation. See --endblock for further caveats.",
+ "names": [
+ "--startblock= block"
+ ],
+ "signature": "--startblock= block"
+ },
+ {
+ "description": "End checking at the specified block number. An error will occur if the table relation being checked has fewer than this number of blocks. This option does not apply to indexes, and is probably only useful when checking a single table relation. If both a regular table and a toast table are checked, this option will apply to both, but higher-numbered toast blocks may still be accessed while validating toast pointers, unless that is suppressed using --exclude-toast-pointers .",
+ "names": [
+ "--endblock= block"
+ ],
+ "signature": "--endblock= block"
+ },
+ {
+ "description": "For each index checked, verify the presence of all heap tuples as index tuples in the index using amcheck 's heapallindexed option.",
+ "names": [
+ "--heapallindexed"
+ ],
+ "signature": "--heapallindexed"
+ },
+ {
+ "description": "For each btree index checked, use amcheck 's bt_index_parent_check function, which performs additional checks of parent/child relationships during index checking. The default is to use amcheck 's bt_index_check function, but note that use of the --rootdescend option implicitly selects bt_index_parent_check .",
+ "names": [
+ "--parent-check"
+ ],
+ "signature": "--parent-check"
+ },
+ {
+ "description": "For each index checked, re-find tuples on the leaf level by performing a new search from the root page for each tuple using amcheck 's rootdescend option. Use of this option implicitly also selects the --parent-check option. This form of verification was originally written to help in the development of btree index features. It may be of limited use or even of no use in helping detect the kinds of corruption that occur in practice. It may also cause corruption checking to take considerably longer and consume considerably more resources on the server.",
+ "names": [
+ "--rootdescend"
+ ],
+ "signature": "--rootdescend"
+ },
+ {
+ "description": "Specifies the host name of the machine on which the server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket.",
+ "names": [
+ "-h hostname",
+ "--host= hostname"
+ ],
+ "signature": "-h hostname --host= hostname"
+ },
+ {
+ "description": "Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections.",
+ "names": [
+ "-p port",
+ "--port= port"
+ ],
+ "signature": "-p port --port= port"
+ },
+ {
+ "description": "User name to connect as.",
+ "names": [
+ "-U",
+ "--username= username"
+ ],
+ "signature": "-U --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_amcheck to prompt for a password before connecting to a database. This option is never essential, since pg_amcheck will automatically prompt for a password if the server demands password authentication. However, pg_amcheck 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.",
+ "names": [
+ "-W",
+ "--password"
+ ],
+ "signature": "-W --password"
+ },
+ {
+ "description": "Specifies a database or connection string to be used to discover the list of databases to be checked. If neither --all nor any option including a database pattern is used, no such connection is required and this option does nothing. Otherwise, any connection string parameters other than the database name which are included in the value for this option will also be used when connecting to the databases being checked. If this option is omitted, the default is postgres or, if that fails, template1 .",
+ "names": [
+ "--maintenance-db= dbname"
+ ],
+ "signature": "--maintenance-db= dbname"
+ },
+ {
+ "description": "Echo to stdout all SQL sent to the server.",
+ "names": [
+ "-e",
+ "--echo"
+ ],
+ "signature": "-e --echo"
+ },
+ {
+ "description": "Use num concurrent connections to the server, or one per object to be checked, whichever is less. The default is to use a single connection.",
+ "names": [
+ "-j num",
+ "--jobs= num"
+ ],
+ "signature": "-j num --jobs= num"
+ },
+ {
+ "description": "Show progress information. Progress information includes the number of relations for which checking has been completed, and the total size of those relations. It also includes the total number of relations that will eventually be checked, and the estimated size of those relations.",
+ "names": [
+ "-P",
+ "--progress"
+ ],
+ "signature": "-P --progress"
+ },
+ {
+ "description": "Print more messages. In particular, this will print a message for each relation being checked, and will increase the level of detail shown for server errors.",
+ "names": [
+ "-v",
+ "--verbose"
+ ],
+ "signature": "-v --verbose"
+ },
+ {
+ "description": "Print the pg_amcheck version and exit.",
+ "names": [
+ "-V",
+ "--version"
+ ],
+ "signature": "-V --version"
+ },
+ {
+ "description": "Install any missing extensions that are required to check the database(s). If not yet installed, each extension's objects will be installed into the given schema , or if not specified into schema pg_catalog . At present, the only required extension is amcheck .",
+ "names": [
+ "--install-missing",
+ "--install-missing= schema"
+ ],
+ "signature": "--install-missing --install-missing= schema"
+ },
+ {
+ "description": "Show help about pg_amcheck command line arguments, and exit.",
+ "names": [
+ "-?",
+ "--help"
+ ],
+ "signature": "-? --help"
+ }
+ ],
+ "synopsis": [
+ "pg_amcheck [ option ...] [ dbname ]"
+ ]
+}
比较已记录的接口与属性,排除来源指纹和构建元数据。某个样本中没有记录,不能据此判断实际引入或移除的版本。
相关条目
导出 JSON · 返回命令行工具 · 收录范围为 PostgreSQL 14 至 20;最早采样版本不一定是实际引入版本。