{"Entry":{"collection":"tool","key":"pg-amcheck","name":"pg_amcheck","aliases":["pg_amcheck"],"metadata":{"aliases":["pg_amcheck"],"category":"Client applications","content_hash":"0bcf8db7e2f3740e119ff65b165f5e8887107fb6da5ebe1dad682b050946e109","derived_content_hash":"c93564626fa5bc62ea8206ea3080ad22154b75813248a898d228ae6eecc24683","imported_at":"2026-09-30T00:40:33.995083+08:00","name":"pg_amcheck","name_zh":"","slug":"pg-amcheck","summary":"pg_amcheck — checks for corruption in one or more PostgreSQL databases"}},"Definition":{"Collection":"tool","Key":"pg-amcheck","SourceDatabase":"center","Version":"18","SourceTable":"command_tool","SourceKey":"pg-amcheck","SourceRevision":"ee8d1a3612338fd9adf250730cb640fcc5233b5491337cc00a316a44e3a0b9f8","Facts":{"comparison_data":{"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 to other relation types.","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 other relation types.","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, materialized views, and sequences, not to 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, materialized views, and sequences, not to 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 with unique constraint checked, verify that no more than one among duplicate entries is visible in the index using amcheck 's checkunique option.","names":["--checkunique"],"signature":"--checkunique"},{"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 ]"]},"comparison_hash":"e007a3ce54383d588583bd426bfaa62aba42504ba26ff80ad24c0c65d13af539","description":["pg_amcheck — checks for corruption in one or more PostgreSQL databases"],"description_zh":"描述 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 排除的除外。 -d pattern --database= pattern 检查匹配指定 pattern 的数据库，但通过 --exclude-database 排除的除外。此选项可指定多次。 -D pattern --exclude-database= pattern 排除匹配指定 pattern 的数据库。此选项可指定多次。 -i pattern --index= pattern 检查匹配指定 pattern 的索引，除非另有排除。此选项可指定多次。 这与 --relation 选项类似，但它只适用于索引，不适用于其他关系类型。 -I pattern --exclu","description_zh_html":"\u003cp\u003e命令行工具 pg_amcheck [ option ...] [ dbname ]。\u003c/p\u003e\u003ch3\u003e同版本中文手册节选\u003c/h3\u003e\u003cdiv class=\"refsect1\"\u003e\u003ch2\u003e描述\u003c/h2\u003e\u003cp\u003e\n\u003cspan class=\"application\"\u003epg_amcheck\u003c/span\u003e 支持针对一个或多个数据库运行 \u003ca class=\"xref\" href=\"/zh/docs/18/amcheck.html\"\u003eamcheck\u003c/a\u003e 的损坏检查函数，并提供选项来选择要检查哪些模式、表和索引，执行哪些检查，以及是否并行执行这些检查；如果并行执行，还可指定要建立并使用的并行连接数。\n  \u003c/p\u003e\u003cp\u003e\n   当前仅支持普通表关系、TOAST 表关系、物化视图、序列以及 B-树索引。其他关系类型会被静默跳过。\n  \u003c/p\u003e\u003cp\u003e\n   如果指定了 \u003ccode class=\"literal\"\u003edbname\u003c/code\u003e，它应是要检查的单个数据库的名称，并且不应再出现其他数据库选择选项。否则，如果存在任何数据库选择选项，就会检查所有匹配的数据库。如果不存在这类选项，则检查默认数据库。数据库选择选项包括 \u003ccode class=\"option\"\u003e--all\u003c/code\u003e、\u003ccode class=\"option\"\u003e--database\u003c/code\u003e 和 \u003ccode class=\"option\"\u003e--exclude-database\u003c/code\u003e。它们还包括 \u003ccode class=\"option\"\u003e--relation\u003c/code\u003e、\u003ccode class=\"option\"\u003e--exclude-relation\u003c/code\u003e、\u003ccode class=\"option\"\u003e--table\u003c/code\u003e、\u003ccode class=\"option\"\u003e--exclude-table\u003c/code\u003e、\u003ccode class=\"option\"\u003e--index\u003c/code\u003e 和 \u003ccode class=\"option\"\u003e--exclude-index\u003c/code\u003e，但仅限于这些选项与三部分模式一起使用时（例如 \u003ccode class=\"option\"\u003emydb*.myschema*.myrel*\u003c/code\u003e）。最后，当 \u003ccode class=\"option\"\u003e--schema\u003c/code\u003e 和 \u003ccode class=\"option\"\u003e--exclude-schema\u003c/code\u003e 与两部分模式一起使用时（例如 \u003ccode class=\"option\"\u003emydb*.myschema*\u003c/code\u003e），它们也属于数据库选择选项。\n  \u003c/p\u003e\u003cp\u003e\n\u003cem class=\"replaceable\"\u003e\u003ccode\u003edbname\u003c/code\u003e\u003c/em\u003e 也可以是\u003ca class=\"link\" href=\"/zh/docs/18/libpq-connect.html#LIBPQ-CONNSTRING\"\u003e连接字符串\u003c/a\u003e。\n  \u003c/p\u003e\u003c/div\u003e\u003cdiv class=\"refsect1\"\u003e\u003ch2\u003e选项\u003c/h2\u003e\u003cp\u003e\n   下列命令行选项控制要检查的内容：\n\n   \u003c/p\u003e\u003cdiv class=\"variablelist\"\u003e\u003cdl class=\"variablelist\"\u003e\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--all\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n       检查所有数据库，但通过 \u003ccode class=\"option\"\u003e--exclude-database\u003c/code\u003e 排除的除外。\n      \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-d \u003cem class=\"replaceable\"\u003e\u003ccode\u003epattern\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\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n       检查匹配指定 \u003ca class=\"link\" href=\"/zh/docs/18/app-psql.html#APP-PSQL-PATTERNS\"\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/a\u003e 的数据库，但通过 \u003ccode class=\"option\"\u003e--exclude-database\u003c/code\u003e 排除的除外。此选项可指定多次。\n      \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-D \u003cem class=\"replaceable\"\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr/\u003e\u003c/span\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\u003cdd\u003e\u003cp\u003e\n       排除匹配指定 \u003ca class=\"link\" href=\"/zh/docs/18/app-psql.html#APP-PSQL-PATTERNS\"\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/a\u003e 的数据库。此选项可指定多次。\n      \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-i \u003cem class=\"replaceable\"\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr/\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--index=\u003cem class=\"replaceable\"\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n       检查匹配指定 \u003ca class=\"link\" href=\"/zh/docs/18/app-psql.html#APP-PSQL-PATTERNS\"\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/a\u003e 的索引，除非另有排除。此选项可指定多次。\n      \u003c/p\u003e\u003cp\u003e\n       这与 \u003ccode class=\"option\"\u003e--relation\u003c/code\u003e 选项类似，但它只适用于索引，不适用于其他关系类型。\n      \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-I \u003cem class=\"replaceable\"\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr/\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--exclude-index=\u003cem class=\"replaceable\"\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n       排除匹配指定 \u003ca class=\"link\" href=\"/zh/docs/18/app-psql.html#APP-PSQL-PATTERNS\"\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/a\u003e 的索引。此选项可指定多次。\n      \u003c/p\u003e\u003cp\u003e\n       这与 \u003ccode class=\"option\"\u003e--exclude-relation\u003c/code\u003e 选项类似，但它只适用于索引，不适用于其他关系类型。\n      \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-r \u003cem class=\"replaceable\"\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr/\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--relation=\u003cem class=\"replaceable\"\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n       检查匹配指定 \u003ca class=\"link\" href=\"/zh/docs/18/app-psql.html#APP-PSQL-PATTERNS\"\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/a\u003e 的关系，除非另有排除。此选项可指定多次。\n      \u003c/p\u003e\u003cp\u003e\n       匹配模式可以是未经限定的，例如 \u003ccode class=\"literal\"\u003emyrel*\u003c/code\u003e；也可以是模式限定的，例如 \u003ccode class=\"literal\"\u003emyschema*.myrel*\u003c/code\u003e；或者同时带数据库限定和模式限定，例如 \u003ccode class=\"literal\"\u003emydb*.myschema*.myrel*\u003c/code\u003e。数据库限定的模式会把匹配的数据库加入待检查数据库列表。\n      \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-R \u003cem class=\"replaceable\"\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr/\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--exclude-relation=\u003cem class=\"replaceable\"\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n       排除匹配指定 \u003ca class=\"link\" href=\"/zh/docs/18/app-psql.html#APP-PSQL-PATTERNS\"\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/a\u003e 的关系。此选项可指定多次。\n      \u003c/p\u003e\u003cp\u003e\n       与 \u003ccode class=\"option\"\u003e--relation\u003c/code\u003e 一样，\u003ca class=\"link\" href=\"/zh/docs/18/app-psql.html#APP-PSQL-PATTERNS\"\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/a\u003e 可以是未经限定的、模式限定的，或者同时带数据库限定和模式限定的。\n      \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-s \u003cem class=\"replaceable\"\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr/\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--schema=\u003cem class=\"replaceable\"\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n       检查匹配指定 \u003ca class=\"link\" href=\"/zh/docs/18/app-psql.html#APP-PSQL-PATTERNS\"\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/a\u003e 的模式中的表和索引，除非另有排除。此选项可指定多次。\n      \u003c/p\u003e\u003cp\u003e\n       若只想选择名称匹配特定模式的那些模式中的表，可考虑使用类似 \u003ccode class=\"literal\"\u003e--table=SCHEMAPAT.* --no-dependent-indexes\u003c/code\u003e 的写法。若只想选择索引，可考虑使用类似 \u003ccode class=\"literal\"\u003e--index=SCHEMAPAT.*\u003c/code\u003e 的写法。\n      \u003c/p\u003e\u003cp\u003e\n       模式匹配串可以带数据库限定。例如，可以写 \u003ccode class=\"literal\"\u003e--schema=mydb*.myschema*\u003c/code\u003e，以在匹配 \u003ccode class=\"literal\"\u003emydb*\u003c/code\u003e 的数据库中选择匹配 \u003ccode class=\"literal\"\u003emyschema*\u003c/code\u003e 的模式。\n      \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-S \u003cem class=\"replaceable\"\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr/\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--exclude-schema=\u003cem class=\"replaceable\"\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n       排除匹配指定 \u003ca class=\"link\" href=\"/zh/docs/18/app-psql.html#APP-PSQL-PATTERNS\"\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/a\u003e 的模式中的表和索引。此选项可指定多次。\n      \u003c/p\u003e\u003cp\u003e\n       与 \u003ccode class=\"option\"\u003e--schema\u003c/code\u003e 一样，该模式可以带数据库限定。\n      \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-t \u003cem class=\"replaceable\"\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr/\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--table=\u003cem class=\"replaceable\"\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n       检查匹配指定 \u003ca class=\"link\" href=\"/zh/docs/18/app-psql.html#APP-PSQL-PATTERNS\"\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/a\u003e 的表，除非另有排除。此选项可指定多次。\n      \u003c/p\u003e\u003cp\u003e\n       这与 \u003ccode class=\"option\"\u003e--relation\u003c/code\u003e 选项类似，但它只适用于表、物化视图和序列，不适用于索引。\n      \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-T \u003cem class=\"replaceable\"\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr/\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--exclude-table=\u003cem class=\"replaceable\"\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n       排除匹配指定 \u003ca class=\"link\" href=\"/zh/docs/18/app-psql.html#APP-PSQL-PATTERNS\"\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/a\u003e 的表。此选项可指定多次。\n      \u003c/p\u003e\u003cp\u003e\n       这与 \u003ccode class=\"option\"\u003e--exclude-relation\u003c/code\u003e 选项类似，但它只适用于表、物化视图和序列，不适用于索引。\n      \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--no-dependent-indexes\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n       默认情况下，如果检查某个表，则该表上的任何 B-树索引也会一并检查，即使它们没有通过 \u003ccode class=\"literal\"\u003e--index\u003c/code\u003e 或 \u003ccode class=\"literal\"\u003e--relation\u003c/code\u003e 等选项显式选中。此选项会禁止这种行为。\n      \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--no-dependent-toast\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n       默认情况下，如果检查某个表，则它的 TOAST 表（如果有）也会一并检查，即使该 TOAST 表没有通过 \u003ccode class=\"literal\"\u003e--table\u003c/code\u003e 或 \u003ccode class=\"literal\"\u003e--relation\u003c/code\u003e 等选项显式选中。此选项会禁止这种行为。\n      \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--no-strict-names\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n       默认情况下，如果 \u003ccode class=\"literal\"\u003e--database\u003c/code\u003e、\u003ccode class=\"literal\"\u003e--table\u003c/code\u003e、\u003ccode class=\"literal\"\u003e--index\u003c/code\u003e 或 \u003ccode class=\"literal\"\u003e--relation\u003c/code\u003e 的某个参数没有匹配到任何对象，就会报致命错误。此选项会将该错误降级为警告。\n      \u003c/p\u003e\u003c/dd\u003e\u003c/dl\u003e\u003c/div\u003e\u003cp\u003e\n\u003c/p\u003e\u003cp\u003e\n   下列命令行选项控制表的检查：\n\n   \u003c/p\u003e\u003cdiv class=\"variablelist\"\u003e\u003cdl class=\"variablelist\"\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--exclude-toast-pointers\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n       默认情况下，只要在表中遇到 TOAST 指针，就会执行查找，以确保它引用的是 TOAST 表中表面看来有效的条目。这些检查可能相当慢，可用此选项跳过。\n      \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--on-error-stop\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n       在某个表中发现损坏后，在报告完该表第一个损坏页面上的全部损坏后，停止处理该表关系并转到下一个表或索引。\n      \u003c/p\u003e\u003cp\u003e\n       注意，索引检查总是在第一个损坏页后停止。此选项只对表关系有意义。\n      \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--skip=\u003cem class=\"replaceable\"\u003e\u003ccode\u003eoption\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n       如果给定 \u003ccode class=\"literal\"\u003eall-frozen\u003c/code\u003e，表损坏检查会跳过所有表中标记为全冻结的页面。\n      \u003c/p\u003e\u003cp\u003e\n       如果给定 \u003ccode class=\"literal\"\u003eall-visible\u003c/code\u003e，表损坏检查会跳过所有表中标记为全可见的页面。\n      \u003c/p\u003e\u003cp\u003e\n       默认不跳过任何页面。这可以显式指定为 \u003ccode class=\"literal\"\u003enone\u003c/code\u003e，但因为这是默认值，通常无需写出。\n      \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--startblock=\u003cem class=\"replaceable\"\u003e\u003ccode\u003eblock\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n       从指定块号开始检查。如果被检查的表关系块数少于这个数字，将发生错误。此选项不适用于索引，而且大概只在检查单个表关系时才有用。进一步的注意事项见 \u003ccode class=\"literal\"\u003e--endblock\u003c/code\u003e。\n      \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--endblock=\u003cem class=\"replaceable\"\u003e\u003ccode\u003eblock\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n       在指定块号结束检查。如果被检查的表关系块数少于这个数字，将发生错误。此选项不适用于索引，而且大概只在检查单个表关系时才有用。如果同时检查普通表和 TOAST 表，此选项会同时作用于两者；但在验证 TOAST 指针时，仍可能访问更高编号的 TOAST 块，除非使用 \u003ccode class=\"option\"\u003e--exclude-toast-pointers\u003c/code\u003e 抑制这一行为。\n      \u003c/p\u003e\u003c/dd\u003e\u003c/dl\u003e\u003c/div\u003e\u003cp\u003e\n\u003c/p\u003e\u003cp\u003e\n   下列命令行选项控制 B-树索引的检查：\n\n   \u003c/p\u003e\u003cdiv class=\"variablelist\"\u003e\u003cdl class=\"variablelist\"\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--checkunique\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n       对于检查的每个带唯一约束的索引，使用 \u003ca class=\"xref\" href=\"/zh/docs/18/amcheck.html\"\u003eamcheck\u003c/a\u003e 的 \u003ccode class=\"option\"\u003echeckunique\u003c/code\u003e 选项，验证重复条目中在索引里可见的项不超过一个。\n      \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--heapallindexed\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n       对于检查的每个索引，使用 \u003ca class=\"xref\" href=\"/zh/docs/18/amcheck.html\"\u003eamcheck\u003c/a\u003e 的 \u003ccode class=\"option\"\u003eheapallindexed\u003c/code\u003e 选项，验证所有堆元组都以索引元组的形式出现在该索引中。\n      \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--parent-check\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n       对于检查的每个 B-树索引，使用 \u003ca class=\"xref\" href=\"/zh/docs/18/amcheck.html\"\u003eamcheck\u003c/a\u003e 的 \u003ccode class=\"function\"\u003ebt_index_parent_check\u003c/code\u003e 函数，该函数会在索引检查期间额外检查父子关系。\n      \u003c/p\u003e\u003cp\u003e\n       默认使用 \u003cspan class=\"application\"\u003eamcheck\u003c/span\u003e 的 \u003ccode class=\"function\"\u003ebt_index_check\u003c/code\u003e 函数，但请注意，使用 \u003ccode class=\"option\"\u003e--rootdescend\u003c/code\u003e 选项会隐式选择 \u003ccode class=\"function\"\u003ebt_index_parent_check\u003c/code\u003e。\n      \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--rootdescend\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n       对于检查的每个索引，使用 \u003ca class=\"xref\" href=\"/zh/docs/18/amcheck.html\"\u003eamcheck\u003c/a\u003e 的 \u003ccode class=\"option\"\u003erootdescend\u003c/code\u003e 选项，为每个元组从根页重新执行一次搜索，从而在叶级重新找到这些元组。\n      \u003c/p\u003e\u003cp\u003e\n       使用此选项也会隐式选择 \u003ccode class=\"option\"\u003e--parent-check\u003c/code\u003e 选项。\n      \u003c/p\u003e\u003cp\u003e\n       这种验证形式最初是为协助开发 B-树索引特性而编写的。它在帮助检测实际发生的那类损坏方面可能用途有限，甚至毫无帮助。它还可能使损坏检查耗时显著增加，并显著增加服务器上的资源消耗。\n      \u003c/p\u003e\u003c/dd\u003e\u003c/dl\u003e\u003c/div\u003e\u003cp\u003e\n\u003c/p\u003e\u003cdiv class=\"warning\"\u003e\u003ch3 class=\"title\"\u003e警告\u003c/h3\u003e\u003cp\u003e\n    当指定 \u003ccode class=\"option\"\u003e--parent-check\u003c/code\u003e 或 \u003ccode class=\"option\"\u003e--rootdescend\u003c/code\u003e 时，对 B-树索引执行的额外检查需要相对较强的关系级锁。这些检查也是唯一会阻塞 \u003ccode class=\"command\"\u003eINSERT\u003c/code\u003e、\u003ccode class=\"command\"\u003eUPDATE\u003c/code\u003e 和 \u003ccode class=\"command\"\u003eDELETE\u003c/code\u003e 命令并发修改数据的检查。\n   \u003c/p\u003e\u003c/div\u003e\u003cp\u003e\n   下列命令行选项控制与服务器的连接：\n\n   \u003c/p\u003e\u003cdiv class=\"variablelist\"\u003e\u003cdl class=\"variablelist\"\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-h \u003cem class=\"replaceable\"\u003e\u003ccode\u003ehostname\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\u003ehostname\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n       指定服务器所在机器的主机名。如果该值以斜杠开头，则将其用作 Unix 域套接字所在的目录。\n      \u003c/p\u003e\u003c/dd\u003e\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\u003cdd\u003e\u003cp\u003e\n       指定服务器监听连接的 TCP 端口或本地 Unix 域套接字文件扩展名。\n      \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-U\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\u003cdd\u003e\u003cp\u003e\n       连接时使用的用户名。\n      \u003c/p\u003e\u003c/dd\u003e\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\u003cdd\u003e\u003cp\u003e\n       永不发出密码提示。如果服务器要求密码认证，而又无法通过其他方式获取密码，例如通过\u003ccode class=\"filename\"\u003e.pgpass\u003c/code\u003e 文件，则连接尝试会失败。此选项可用于没有用户在场输入密码的批处理作业和脚本。\n      \u003c/p\u003e\u003c/dd\u003e\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\u003cdd\u003e\u003cp\u003e\n       强制 \u003cspan class=\"application\"\u003epg_amcheck\u003c/span\u003e 在连接数据库前提示输入密码。\n      \u003c/p\u003e\u003cp\u003e\n       该选项并非必需，因为如果服务器要求密码认证，\u003cspan class=\"application\"\u003epg_amcheck\u003c/span\u003e 会自动提示输入密码。不过，\u003cspan class=\"application\"\u003epg_amcheck\u003c/span\u003e 会先浪费一次连接尝试，才能发现服务器需要密码。在某些场景下，值得显式指定 \u003ccode class=\"option\"\u003e-W\u003c/code\u003e，以避免这次额外的连接尝试。\n      \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--maintenance-db=\u003cem class=\"replaceable\"\u003e\u003ccode\u003edbname\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n       指定一个数据库或\u003ca class=\"link\" href=\"/zh/docs/18/libpq-connect.html#LIBPQ-CONNSTRING\"\u003e连接字符串\u003c/a\u003e，用于确定待检查的数据库列表。如果既未使用 \u003ccode class=\"option\"\u003e--all\u003c/code\u003e，也未使用任何包含数据库名称匹配模式的选项，则不需要这样的连接，此选项也不起作用。否则，此选项值中除数据库名之外的任何连接字符串参数，在连接待检查的数据库时也会一并使用。如果省略此选项，默认值为 \u003ccode class=\"literal\"\u003epostgres\u003c/code\u003e；若失败，则为 \u003ccode class=\"literal\"\u003etemplate1\u003c/code\u003e。\n      \u003c/p\u003e\u003c/dd\u003e\u003c/dl\u003e\u003c/div\u003e\u003cp\u003e\n\u003c/p\u003e\u003cp\u003e\n   还提供下列其他选项：\n\n   \u003c/p\u003e\u003cdiv class=\"variablelist\"\u003e\u003cdl class=\"variablelist\"\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-e\u003c/code\u003e\u003cbr/\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--echo\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n       将发送到服务器的所有 SQL 回显到标准输出。\n      \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-j \u003cem class=\"replaceable\"\u003e\u003ccode\u003enum\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr/\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--jobs=\u003cem class=\"replaceable\"\u003e\u003ccode\u003enum\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n       使用 \u003cem class=\"replaceable\"\u003e\u003ccode\u003enum\u003c/code\u003e\u003c/em\u003e 个到服务器的并发连接，或者为每个待检查对象使用一个连接，以较小者为准。\n      \u003c/p\u003e\u003cp\u003e\n       默认使用单个连接。\n      \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-P\u003c/code\u003e\u003cbr/\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--progress\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n       显示进度信息。进度信息包括已完成检查的关系数量及其总大小，也包括最终将要检查的关系总数及这些关系的估计大小。\n      \u003c/p\u003e\u003c/dd\u003e\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\u003cdd\u003e\u003cp\u003e\n       打印更多消息。特别是，它会为每个正在检查的关系打印一条消息，并提高服务器错误显示的详细程度。\n      \u003c/p\u003e\u003c/dd\u003e\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\u003cdd\u003e\u003cp\u003e\n       打印 \u003cspan class=\"application\"\u003epg_amcheck\u003c/span\u003e 版本并退出。\n      \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--install-missing\u003c/code\u003e\u003cbr/\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--install-missing=\u003cem class=\"replaceable\"\u003e\u003ccode\u003eschema\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n       安装检查数据库所需的任何缺失扩展。如果某个扩展尚未安装，则其对象将安装到给定的 \u003cem class=\"replaceable\"\u003e\u003ccode\u003eschema\u003c/code\u003e\u003c/em\u003e 中；如果未指定，则安装到 \u003ccode class=\"literal\"\u003epg_catalog\u003c/code\u003e 模式中。\n      \u003c/p\u003e\u003cp\u003e\n       目前，唯一必需的扩展是 \u003ca class=\"xref\" href=\"/zh/docs/18/amcheck.html\"\u003eamcheck\u003c/a\u003e。\n      \u003c/p\u003e\u003c/dd\u003e\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\u003cdd\u003e\u003cp\u003e\n       显示 \u003cspan class=\"application\"\u003epg_amcheck\u003c/span\u003e 命令行参数的帮助并退出。\n      \u003c/p\u003e\u003c/dd\u003e\u003c/dl\u003e\u003c/div\u003e\u003cp\u003e\n\u003c/p\u003e\u003c/div\u003e\u003cp\u003e\u003ca href=\"/zh/docs/18/app-pgamcheck.html\"\u003e查看完整中文手册与上下文\u003c/a\u003e。\u003c/p\u003e","environment":[],"facts":[{"label":"Documented executable","value":"pg_amcheck"},{"label":"Executable version","value":"18.6"},{"label":"Reference inventory","value":"Client applications"},{"label":"Option definition groups","value":"36"}],"facts_zh":[{"label":"手册中的可执行程序","value":"pg_amcheck"},{"label":"程序版本","value":"18.6"},{"label":"参考清单","value":"客户端程序"},{"label":"选项定义组","value":"36"}],"manual_html":"\u003cdiv\u003e\u003cdiv class=\"refentry\" id=\"APP-PGAMCHECK\"\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_amcheck\u003c/span\u003e\u003c/span\u003e\u003c/h2\u003e\n\u003cp\u003epg_amcheck — checks for corruption in one or more \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e databases\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.9.4.1\"\u003e\u003ccode class=\"command\"\u003epg_amcheck\u003c/code\u003e [\u003cem class=\"replaceable\"\u003e\u003ccode\u003eoption\u003c/code\u003e\u003c/em\u003e...] [\u003cem class=\"replaceable\"\u003e\u003ccode\u003edbname\u003c/code\u003e\u003c/em\u003e]\u003c/p\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.4.9.5\"\u003e\n\u003ch2\u003eDescription\u003c/h2\u003e\n\u003cp\u003e\u003cspan class=\"application\"\u003epg_amcheck\u003c/span\u003e supports running \u003ca class=\"xref\" href=\"/docs/18/amcheck.html\" title=\"F.1. amcheck — tools to verify table and index consistency\"\u003eamcheck\u003c/a\u003e's corruption checking functions against one or more databases, with options to select which schemas, tables and indexes to check, which kinds of checking to perform, and whether to perform the checks in parallel, and if so, the number of parallel connections to establish and use.\u003c/p\u003e\n\u003cp\u003eOnly ordinary and toast table relations, materialized views, sequences, and btree indexes are currently supported. Other relation types are silently skipped.\u003c/p\u003e\n\u003cp\u003eIf \u003ccode class=\"literal\"\u003edbname\u003c/code\u003e is specified, it should be the name of a single database to check, and no other database selection options should be present. Otherwise, if any database selection options are present, all matching databases will be checked. If no such options are present, the default database will be checked. Database selection options include \u003ccode class=\"option\"\u003e--all\u003c/code\u003e, \u003ccode class=\"option\"\u003e--database\u003c/code\u003e and \u003ccode class=\"option\"\u003e--exclude-database\u003c/code\u003e. They also include \u003ccode class=\"option\"\u003e--relation\u003c/code\u003e, \u003ccode class=\"option\"\u003e--exclude-relation\u003c/code\u003e, \u003ccode class=\"option\"\u003e--table\u003c/code\u003e, \u003ccode class=\"option\"\u003e--exclude-table\u003c/code\u003e, \u003ccode class=\"option\"\u003e--index\u003c/code\u003e, and \u003ccode class=\"option\"\u003e--exclude-index\u003c/code\u003e, but only when such options are used with a three-part pattern (e.g. \u003ccode class=\"option\"\u003emydb*.myschema*.myrel*\u003c/code\u003e). Finally, they include \u003ccode class=\"option\"\u003e--schema\u003c/code\u003e and \u003ccode class=\"option\"\u003e--exclude-schema\u003c/code\u003e when such options are used with a two-part pattern (e.g. \u003ccode class=\"option\"\u003emydb*.myschema*\u003c/code\u003e).\u003c/p\u003e\n\u003cp\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003edbname\u003c/code\u003e\u003c/em\u003e can also be a \u003ca class=\"link\" href=\"/docs/18/libpq-connect.html#LIBPQ-CONNSTRING\" title=\"32.1.1. Connection Strings\"\u003econnection string\u003c/a\u003e.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.4.9.6\"\u003e\n\u003ch2\u003eOptions\u003c/h2\u003e\n\u003cp\u003eThe following command-line options control what is checked:\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--all\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eCheck all databases, except for any excluded via \u003ccode class=\"option\"\u003e--exclude-database\u003c/code\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-d \u003cem class=\"replaceable\"\u003e\u003ccode\u003epattern\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\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eCheck databases matching the specified \u003ca class=\"link\" href=\"/docs/18/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/a\u003e, except for any excluded by \u003ccode class=\"option\"\u003e--exclude-database\u003c/code\u003e. This option can be specified more than once.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-D \u003cem class=\"replaceable\"\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\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\u003eExclude databases matching the given \u003ca class=\"link\" href=\"/docs/18/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/a\u003e. This option can be specified more than once.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-i \u003cem class=\"replaceable\"\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--index=\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\u003eCheck indexes matching the specified \u003ca class=\"link\" href=\"/docs/18/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/a\u003e, unless they are otherwise excluded. This option can be specified more than once.\u003c/p\u003e\n\u003cp\u003eThis is similar to the \u003ccode class=\"option\"\u003e--relation\u003c/code\u003e option, except that it applies only to indexes, not to other relation types.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-I \u003cem class=\"replaceable\"\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--exclude-index=\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\u003eExclude indexes matching the specified \u003ca class=\"link\" href=\"/docs/18/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/a\u003e. This option can be specified more than once.\u003c/p\u003e\n\u003cp\u003eThis is similar to the \u003ccode class=\"option\"\u003e--exclude-relation\u003c/code\u003e option, except that it applies only to indexes, not other relation types.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-r \u003cem class=\"replaceable\"\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--relation=\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\u003eCheck relations matching the specified \u003ca class=\"link\" href=\"/docs/18/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/a\u003e, unless they are otherwise excluded. This option can be specified more than once.\u003c/p\u003e\n\u003cp\u003ePatterns may be unqualified, e.g. \u003ccode class=\"literal\"\u003emyrel*\u003c/code\u003e, or they may be schema-qualified, e.g. \u003ccode class=\"literal\"\u003emyschema*.myrel*\u003c/code\u003e or database-qualified and schema-qualified, e.g. \u003ccode class=\"literal\"\u003emydb*.myschema*.myrel*\u003c/code\u003e. A database-qualified pattern will add matching databases to the list of databases to be checked.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-R \u003cem class=\"replaceable\"\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--exclude-relation=\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\u003eExclude relations matching the specified \u003ca class=\"link\" href=\"/docs/18/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/a\u003e. This option can be specified more than once.\u003c/p\u003e\n\u003cp\u003eAs with \u003ccode class=\"option\"\u003e--relation\u003c/code\u003e, the \u003ca class=\"link\" href=\"/docs/18/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/a\u003e may be unqualified, schema-qualified, or database- and schema-qualified.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-s \u003cem class=\"replaceable\"\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--schema=\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\u003eCheck tables and indexes in schemas matching the specified \u003ca class=\"link\" href=\"/docs/18/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/a\u003e, unless they are otherwise excluded. This option can be specified more than once.\u003c/p\u003e\n\u003cp\u003eTo select only tables in schemas matching a particular pattern, consider using something like \u003ccode class=\"literal\"\u003e--table=SCHEMAPAT.* --no-dependent-indexes\u003c/code\u003e. To select only indexes, consider using something like \u003ccode class=\"literal\"\u003e--index=SCHEMAPAT.*\u003c/code\u003e.\u003c/p\u003e\n\u003cp\u003eA schema pattern may be database-qualified. For example, you may write \u003ccode class=\"literal\"\u003e--schema=mydb*.myschema*\u003c/code\u003e to select schemas matching \u003ccode class=\"literal\"\u003emyschema*\u003c/code\u003e in databases matching \u003ccode class=\"literal\"\u003emydb*\u003c/code\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-S \u003cem class=\"replaceable\"\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--exclude-schema=\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\u003eExclude tables and indexes in schemas matching the specified \u003ca class=\"link\" href=\"/docs/18/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/a\u003e. This option can be specified more than once.\u003c/p\u003e\n\u003cp\u003eAs with \u003ccode class=\"option\"\u003e--schema\u003c/code\u003e, the pattern may be database-qualified.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-t \u003cem class=\"replaceable\"\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--table=\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\u003eCheck tables matching the specified \u003ca class=\"link\" href=\"/docs/18/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/a\u003e, unless they are otherwise excluded. This option can be specified more than once.\u003c/p\u003e\n\u003cp\u003eThis is similar to the \u003ccode class=\"option\"\u003e--relation\u003c/code\u003e option, except that it applies only to tables, materialized views, and sequences, not to indexes.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-T \u003cem class=\"replaceable\"\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--exclude-table=\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\u003eExclude tables matching the specified \u003ca class=\"link\" href=\"/docs/18/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/a\u003e. This option can be specified more than once.\u003c/p\u003e\n\u003cp\u003eThis is similar to the \u003ccode class=\"option\"\u003e--exclude-relation\u003c/code\u003e option, except that it applies only to tables, materialized views, and sequences, not to indexes.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--no-dependent-indexes\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eBy 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 \u003ccode class=\"literal\"\u003e--index\u003c/code\u003e or \u003ccode class=\"literal\"\u003e--relation\u003c/code\u003e. This option suppresses that behavior.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--no-dependent-toast\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eBy 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 \u003ccode class=\"literal\"\u003e--table\u003c/code\u003e or \u003ccode class=\"literal\"\u003e--relation\u003c/code\u003e. This option suppresses that behavior.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--no-strict-names\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eBy default, if an argument to \u003ccode class=\"literal\"\u003e--database\u003c/code\u003e, \u003ccode class=\"literal\"\u003e--table\u003c/code\u003e, \u003ccode class=\"literal\"\u003e--index\u003c/code\u003e, or \u003ccode class=\"literal\"\u003e--relation\u003c/code\u003e matches no objects, it is a fatal error. This option downgrades that error to a warning.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003cp\u003eThe following command-line options control checking of tables:\u003c/p\u003e\n\u003cdiv class=\"variablelist\"\u003e\n\u003cdl class=\"variablelist\"\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--exclude-toast-pointers\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eBy 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.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--on-error-stop\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eAfter 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.\u003c/p\u003e\n\u003cp\u003eNote that index checking always stops after the first corrupt page. This option only has meaning relative to table relations.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--skip=\u003cem class=\"replaceable\"\u003e\u003ccode\u003eoption\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eIf \u003ccode class=\"literal\"\u003eall-frozen\u003c/code\u003e is given, table corruption checks will skip over pages in all tables that are marked as all frozen.\u003c/p\u003e\n\u003cp\u003eIf \u003ccode class=\"literal\"\u003eall-visible\u003c/code\u003e is given, table corruption checks will skip over pages in all tables that are marked as all visible.\u003c/p\u003e\n\u003cp\u003eBy default, no pages are skipped. This can be specified as \u003ccode class=\"literal\"\u003enone\u003c/code\u003e, but since this is the default, it need not be mentioned.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--startblock=\u003cem class=\"replaceable\"\u003e\u003ccode\u003eblock\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eStart 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 \u003ccode class=\"literal\"\u003e--endblock\u003c/code\u003e for further caveats.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--endblock=\u003cem class=\"replaceable\"\u003e\u003ccode\u003eblock\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eEnd 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 \u003ccode class=\"option\"\u003e--exclude-toast-pointers\u003c/code\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003cp\u003eThe following command-line options control checking of B-tree indexes:\u003c/p\u003e\n\u003cdiv class=\"variablelist\"\u003e\n\u003cdl class=\"variablelist\"\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--checkunique\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eFor each index with unique constraint checked, verify that no more than one among duplicate entries is visible in the index using \u003ca class=\"xref\" href=\"/docs/18/amcheck.html\" title=\"F.1. amcheck — tools to verify table and index consistency\"\u003eamcheck\u003c/a\u003e's \u003ccode class=\"option\"\u003echeckunique\u003c/code\u003e option.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--heapallindexed\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eFor each index checked, verify the presence of all heap tuples as index tuples in the index using \u003ca class=\"xref\" href=\"/docs/18/amcheck.html\" title=\"F.1. amcheck — tools to verify table and index consistency\"\u003eamcheck\u003c/a\u003e's \u003ccode class=\"option\"\u003eheapallindexed\u003c/code\u003e option.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--parent-check\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eFor each btree index checked, use \u003ca class=\"xref\" href=\"/docs/18/amcheck.html\" title=\"F.1. amcheck — tools to verify table and index consistency\"\u003eamcheck\u003c/a\u003e's \u003ccode class=\"function\"\u003ebt_index_parent_check\u003c/code\u003e function, which performs additional checks of parent/child relationships during index checking.\u003c/p\u003e\n\u003cp\u003eThe default is to use \u003cspan class=\"application\"\u003eamcheck\u003c/span\u003e's \u003ccode class=\"function\"\u003ebt_index_check\u003c/code\u003e function, but note that use of the \u003ccode class=\"option\"\u003e--rootdescend\u003c/code\u003e option implicitly selects \u003ccode class=\"function\"\u003ebt_index_parent_check\u003c/code\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--rootdescend\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eFor each index checked, re-find tuples on the leaf level by performing a new search from the root page for each tuple using \u003ca class=\"xref\" href=\"/docs/18/amcheck.html\" title=\"F.1. amcheck — tools to verify table and index consistency\"\u003eamcheck\u003c/a\u003e's \u003ccode class=\"option\"\u003erootdescend\u003c/code\u003e option.\u003c/p\u003e\n\u003cp\u003eUse of this option implicitly also selects the \u003ccode class=\"option\"\u003e--parent-check\u003c/code\u003e option.\u003c/p\u003e\n\u003cp\u003eThis 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.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003cdiv class=\"warning\"\u003e\n\u003ch3 class=\"title\"\u003eWarning\u003c/h3\u003e\n\u003cp\u003eThe extra checks performed against B-tree indexes when the \u003ccode class=\"option\"\u003e--parent-check\u003c/code\u003e option or the \u003ccode class=\"option\"\u003e--rootdescend\u003c/code\u003e option is specified require relatively strong relation-level locks. These checks are the only checks that will block concurrent data modification from \u003ccode class=\"command\"\u003eINSERT\u003c/code\u003e, \u003ccode class=\"command\"\u003eUPDATE\u003c/code\u003e, and \u003ccode class=\"command\"\u003eDELETE\u003c/code\u003e commands.\u003c/p\u003e\n\u003c/div\u003e\n\u003cp\u003eThe following command-line options control the connection to the server:\u003c/p\u003e\n\u003cdiv class=\"variablelist\"\u003e\n\u003cdl class=\"variablelist\"\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-h \u003cem class=\"replaceable\"\u003e\u003ccode\u003ehostname\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\u003ehostname\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 server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket.\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.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-U\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_amcheck\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_amcheck\u003c/span\u003e will automatically prompt for a password if the server demands password authentication. However, \u003cspan class=\"application\"\u003epg_amcheck\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\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--maintenance-db=\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 a database or \u003ca class=\"link\" href=\"/docs/18/libpq-connect.html#LIBPQ-CONNSTRING\" title=\"32.1.1. Connection Strings\"\u003econnection string\u003c/a\u003e to be used to discover the list of databases to be checked. If neither \u003ccode class=\"option\"\u003e--all\u003c/code\u003e 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 \u003ccode class=\"literal\"\u003epostgres\u003c/code\u003e or, if that fails, \u003ccode class=\"literal\"\u003etemplate1\u003c/code\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003cp\u003eOther options are also available:\u003c/p\u003e\n\u003cdiv class=\"variablelist\"\u003e\n\u003cdl class=\"variablelist\"\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--echo\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eEcho to stdout all SQL sent to the server.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-j \u003cem class=\"replaceable\"\u003e\u003ccode\u003enum\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--jobs=\u003cem class=\"replaceable\"\u003e\u003ccode\u003enum\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eUse \u003cem class=\"replaceable\"\u003e\u003ccode\u003enum\u003c/code\u003e\u003c/em\u003e concurrent connections to the server, or one per object to be checked, whichever is less.\u003c/p\u003e\n\u003cp\u003eThe default is to use a single connection.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-P\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--progress\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eShow 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.\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\u003ePrint 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.\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_amcheck\u003c/span\u003e version and exit.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--install-missing\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--install-missing=\u003cem class=\"replaceable\"\u003e\u003ccode\u003eschema\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eInstall 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 \u003cem class=\"replaceable\"\u003e\u003ccode\u003eschema\u003c/code\u003e\u003c/em\u003e, or if not specified into schema \u003ccode class=\"literal\"\u003epg_catalog\u003c/code\u003e.\u003c/p\u003e\n\u003cp\u003eAt present, the only required extension is \u003ca class=\"xref\" href=\"/docs/18/amcheck.html\" title=\"F.1. amcheck — tools to verify table and index consistency\"\u003eamcheck\u003c/a\u003e.\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_amcheck\u003c/span\u003e command line arguments, and exit.\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.9.7\"\u003e\n\u003ch2\u003eEnvironment\u003c/h2\u003e\n\u003cp\u003e\u003ccode class=\"command\"\u003epg_amcheck\u003c/code\u003e, 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\u003cp\u003eThe environment variable \u003ccode class=\"envar\"\u003ePG_COLOR\u003c/code\u003e specifies 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/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.4.9.8\"\u003e\n\u003ch2\u003eNotes\u003c/h2\u003e\n\u003cp\u003e\u003cspan class=\"application\"\u003epg_amcheck\u003c/span\u003e is designed to work with \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e 14.0 and later.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.4.9.9\"\u003e\n\u003ch2\u003eSee Also\u003c/h2\u003e\u003cspan class=\"simplelist\"\u003e\u003ca class=\"xref\" href=\"/docs/18/amcheck.html\" title=\"F.1. amcheck — tools to verify table and index consistency\"\u003eamcheck\u003c/a\u003e\u003c/span\u003e\n\u003c/div\u003e\n\u003c/div\u003e\u003c/div\u003e","manual_path":"app-pgamcheck.html","options":[{"description":"Check all databases, except for any excluded via --exclude-database .","names":["-a","--all"],"signature":"-a --all","source_url":"/docs/18/app-pgamcheck.html","summary":"Check all databases, except for any excluded via --exclude-database ."},{"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","source_url":"/docs/18/app-pgamcheck.html","summary":"Check databases matching the specified pattern , except for any excluded by --exclude-database . This option can be specified more than once."},{"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","source_url":"/docs/18/app-pgamcheck.html","summary":"Exclude databases matching the given pattern . This option can be specified more than once."},{"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 to other relation types.","names":["-i pattern","--index= pattern"],"signature":"-i pattern --index= pattern","source_url":"/docs/18/app-pgamcheck.html","summary":"Check indexes matching the specified pattern , unless they are otherwise excluded. This option can be specified more than once."},{"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 other relation types.","names":["-I pattern","--exclude-index= pattern"],"signature":"-I pattern --exclude-index= pattern","source_url":"/docs/18/app-pgamcheck.html","summary":"Exclude indexes matching the specified pattern . This option can be specified more than once."},{"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","source_url":"/docs/18/app-pgamcheck.html","summary":"Check relations matching the specified pattern , unless they are otherwise excluded. This option can be specified more than once."},{"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","source_url":"/docs/18/app-pgamcheck.html","summary":"Exclude relations matching the specified pattern . This option can be specified more than once."},{"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","source_url":"/docs/18/app-pgamcheck.html","summary":"Check tables and indexes in schemas matching the specified pattern , unless they are otherwise excluded. This option can be specified more than once."},{"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","source_url":"/docs/18/app-pgamcheck.html","summary":"Exclude tables and indexes in schemas matching the specified pattern . This option can be specified more than once."},{"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, materialized views, and sequences, not to indexes.","names":["-t pattern","--table= pattern"],"signature":"-t pattern --table= pattern","source_url":"/docs/18/app-pgamcheck.html","summary":"Check tables matching the specified pattern , unless they are otherwise excluded. This option can be specified more than once."},{"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, materialized views, and sequences, not to indexes.","names":["-T pattern","--exclude-table= pattern"],"signature":"-T pattern --exclude-table= pattern","source_url":"/docs/18/app-pgamcheck.html","summary":"Exclude tables matching the specified pattern . This option can be specified more than once."},{"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","source_url":"/docs/18/app-pgamcheck.html","summary":"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."},{"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","source_url":"/docs/18/app-pgamcheck.html","summary":"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."},{"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","source_url":"/docs/18/app-pgamcheck.html","summary":"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."},{"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","source_url":"/docs/18/app-pgamcheck.html","summary":"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."},{"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","source_url":"/docs/18/app-pgamcheck.html","summary":"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."},{"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","source_url":"/docs/18/app-pgamcheck.html","summary":"If all-frozen is given, table corruption checks will skip over pages in all tables that are marked as all frozen."},{"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","source_url":"/docs/18/app-pgamcheck.html","summary":"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."},{"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","source_url":"/docs/18/app-pgamcheck.html","summary":"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 ."},{"description":"For each index with unique constraint checked, verify that no more than one among duplicate entries is visible in the index using amcheck 's checkunique option.","names":["--checkunique"],"signature":"--checkunique","source_url":"/docs/18/app-pgamcheck.html","summary":"For each index with unique constraint checked, verify that no more than one among duplicate entries is visible in the index using amcheck 's checkunique option."},{"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","source_url":"/docs/18/app-pgamcheck.html","summary":"For each index checked, verify the presence of all heap tuples as index tuples in the index using amcheck 's heapallindexed option."},{"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","source_url":"/docs/18/app-pgamcheck.html","summary":"For each btree index checked, use amcheck 's bt_index_parent_check function, which performs additional checks of parent/child relationships during index checking."},{"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","source_url":"/docs/18/app-pgamcheck.html","summary":"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."},{"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","source_url":"/docs/18/app-pgamcheck.html","summary":"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."},{"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","source_url":"/docs/18/app-pgamcheck.html","summary":"Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections."},{"description":"User name to connect as.","names":["-U","--username= username"],"signature":"-U --username= username","source_url":"/docs/18/app-pgamcheck.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-pgamcheck.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_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","source_url":"/docs/18/app-pgamcheck.html","summary":"Force pg_amcheck to prompt for a password before connecting to a database."},{"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","source_url":"/docs/18/app-pgamcheck.html","summary":"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 ."},{"description":"Echo to stdout all SQL sent to the server.","names":["-e","--echo"],"signature":"-e --echo","source_url":"/docs/18/app-pgamcheck.html","summary":"Echo to stdout all SQL sent to the server."},{"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","source_url":"/docs/18/app-pgamcheck.html","summary":"Use num concurrent connections to the server, or one per object to be checked, whichever is less."},{"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","source_url":"/docs/18/app-pgamcheck.html","summary":"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."},{"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","source_url":"/docs/18/app-pgamcheck.html","summary":"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."},{"description":"Print the pg_amcheck version and exit.","names":["-V","--version"],"signature":"-V --version","source_url":"/docs/18/app-pgamcheck.html","summary":"Print the pg_amcheck version and exit."},{"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","source_url":"/docs/18/app-pgamcheck.html","summary":"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 ."},{"description":"Show help about pg_amcheck command line arguments, and exit.","names":["-?","--help"],"signature":"-? --help","source_url":"/docs/18/app-pgamcheck.html","summary":"Show help about pg_amcheck command line arguments, and exit."}],"related":[],"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":[],"sections_zh":[],"signature":"pg_amcheck [ option ...] [ dbname ]","sources":[{"anchor":"","file":"app-pgamcheck.html","label":"18.6 English manual · app-pgamcheck.html","sha256":"e27a4203de24586f422047021fddd4cd69bbe0093c3949ac283091329050c9f5","url":"/docs/18/app-pgamcheck.html"},{"anchor":"","file":"reference-client.html","label":"Client applications inventory","sha256":"68f726af77272fe73a827be2b7b5958d0f2239a6f8ed44264e9d42496bfa4fd0","url":"/docs/18/reference-client.html"}],"synopsis":["pg_amcheck [ option ...] [ dbname ]"],"tables":[{"columns":[{"key":"signature","label":"Option and arguments"},{"key":"summary","label":"Description"}],"key":"options","rows":[{"signature":{"text":"-a --all","url":"/docs/18/app-pgamcheck.html"},"summary":"Check all databases, except for any excluded via --exclude-database ."},{"signature":{"text":"-d pattern --database= pattern","url":"/docs/18/app-pgamcheck.html"},"summary":"Check databases matching the specified pattern , except for any excluded by --exclude-database . This option can be specified more than once."},{"signature":{"text":"-D pattern --exclude-database= pattern","url":"/docs/18/app-pgamcheck.html"},"summary":"Exclude databases matching the given pattern . This option can be specified more than once."},{"signature":{"text":"-i pattern --index= pattern","url":"/docs/18/app-pgamcheck.html"},"summary":"Check indexes matching the specified pattern , unless they are otherwise excluded. This option can be specified more than once."},{"signature":{"text":"-I pattern --exclude-index= pattern","url":"/docs/18/app-pgamcheck.html"},"summary":"Exclude indexes matching the specified pattern . This option can be specified more than once."},{"signature":{"text":"-r pattern --relation= pattern","url":"/docs/18/app-pgamcheck.html"},"summary":"Check relations matching the specified pattern , unless they are otherwise excluded. This option can be specified more than once."},{"signature":{"text":"-R pattern --exclude-relation= pattern","url":"/docs/18/app-pgamcheck.html"},"summary":"Exclude relations matching the specified pattern . This option can be specified more than once."},{"signature":{"text":"-s pattern --schema= pattern","url":"/docs/18/app-pgamcheck.html"},"summary":"Check tables and indexes in schemas matching the specified pattern , unless they are otherwise excluded. This option can be specified more than once."},{"signature":{"text":"-S pattern --exclude-schema= pattern","url":"/docs/18/app-pgamcheck.html"},"summary":"Exclude tables and indexes in schemas matching the specified pattern . This option can be specified more than once."},{"signature":{"text":"-t pattern --table= pattern","url":"/docs/18/app-pgamcheck.html"},"summary":"Check tables matching the specified pattern , unless they are otherwise excluded. This option can be specified more than once."},{"signature":{"text":"-T pattern --exclude-table= pattern","url":"/docs/18/app-pgamcheck.html"},"summary":"Exclude tables matching the specified pattern . This option can be specified more than once."},{"signature":{"text":"--no-dependent-indexes","url":"/docs/18/app-pgamcheck.html"},"summary":"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."},{"signature":{"text":"--no-dependent-toast","url":"/docs/18/app-pgamcheck.html"},"summary":"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."},{"signature":{"text":"--no-strict-names","url":"/docs/18/app-pgamcheck.html"},"summary":"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."},{"signature":{"text":"--exclude-toast-pointers","url":"/docs/18/app-pgamcheck.html"},"summary":"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."},{"signature":{"text":"--on-error-stop","url":"/docs/18/app-pgamcheck.html"},"summary":"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."},{"signature":{"text":"--skip= option","url":"/docs/18/app-pgamcheck.html"},"summary":"If all-frozen is given, table corruption checks will skip over pages in all tables that are marked as all frozen."},{"signature":{"text":"--startblock= block","url":"/docs/18/app-pgamcheck.html"},"summary":"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."},{"signature":{"text":"--endblock= block","url":"/docs/18/app-pgamcheck.html"},"summary":"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 ."},{"signature":{"text":"--checkunique","url":"/docs/18/app-pgamcheck.html"},"summary":"For each index with unique constraint checked, verify that no more than one among duplicate entries is visible in the index using amcheck 's checkunique option."},{"signature":{"text":"--heapallindexed","url":"/docs/18/app-pgamcheck.html"},"summary":"For each index checked, verify the presence of all heap tuples as index tuples in the index using amcheck 's heapallindexed option."},{"signature":{"text":"--parent-check","url":"/docs/18/app-pgamcheck.html"},"summary":"For each btree index checked, use amcheck 's bt_index_parent_check function, which performs additional checks of parent/child relationships during index checking."},{"signature":{"text":"--rootdescend","url":"/docs/18/app-pgamcheck.html"},"summary":"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."},{"signature":{"text":"-h hostname --host= hostname","url":"/docs/18/app-pgamcheck.html"},"summary":"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."},{"signature":{"text":"-p port --port= port","url":"/docs/18/app-pgamcheck.html"},"summary":"Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections."},{"signature":{"text":"-U --username= username","url":"/docs/18/app-pgamcheck.html"},"summary":"User name to connect as."},{"signature":{"text":"-w --no-password","url":"/docs/18/app-pgamcheck.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-pgamcheck.html"},"summary":"Force pg_amcheck to prompt for a password before connecting to a database."},{"signature":{"text":"--maintenance-db= dbname","url":"/docs/18/app-pgamcheck.html"},"summary":"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 ."},{"signature":{"text":"-e --echo","url":"/docs/18/app-pgamcheck.html"},"summary":"Echo to stdout all SQL sent to the server."},{"signature":{"text":"-j num --jobs= num","url":"/docs/18/app-pgamcheck.html"},"summary":"Use num concurrent connections to the server, or one per object to be checked, whichever is less."},{"signature":{"text":"-P --progress","url":"/docs/18/app-pgamcheck.html"},"summary":"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."},{"signature":{"text":"-v --verbose","url":"/docs/18/app-pgamcheck.html"},"summary":"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."},{"signature":{"text":"-V --version","url":"/docs/18/app-pgamcheck.html"},"summary":"Print the pg_amcheck version and exit."},{"signature":{"text":"--install-missing --install-missing= schema","url":"/docs/18/app-pgamcheck.html"},"summary":"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 ."},{"signature":{"text":"-? --help","url":"/docs/18/app-pgamcheck.html"},"summary":"Show help about pg_amcheck command line arguments, and exit."}],"title":"Documented options"}],"tables_zh":[{"columns":[{"key":"signature","label":"选项与参数"},{"key":"summary","label":"说明"}],"key":"options","rows":[{"signature":{"text":"-a --all","url":"/docs/18/app-pgamcheck.html"},"summary":"检查所有数据库，但通过 --exclude-database 排除的除外。"},{"signature":{"text":"-d pattern --database= pattern","url":"/docs/18/app-pgamcheck.html"},"summary":"检查匹配指定 pattern 的数据库，但通过 --exclude-database 排除的除外。此选项可指定多次。"},{"signature":{"text":"-D pattern --exclude-database= pattern","url":"/docs/18/app-pgamcheck.html"},"summary":"排除匹配指定 pattern 的数据库。此选项可指定多次。"},{"signature":{"text":"-i pattern --index= pattern","url":"/docs/18/app-pgamcheck.html"},"summary":"检查匹配指定 pattern 的索引，除非另有排除。此选项可指定多次。"},{"signature":{"text":"-I pattern --exclude-index= pattern","url":"/docs/18/app-pgamcheck.html"},"summary":"排除匹配指定 pattern 的索引。此选项可指定多次。"},{"signature":{"text":"-r pattern --relation= pattern","url":"/docs/18/app-pgamcheck.html"},"summary":"检查匹配指定 pattern 的关系，除非另有排除。此选项可指定多次。"},{"signature":{"text":"-R pattern --exclude-relation= pattern","url":"/docs/18/app-pgamcheck.html"},"summary":"排除匹配指定 pattern 的关系。此选项可指定多次。"},{"signature":{"text":"-s pattern --schema= pattern","url":"/docs/18/app-pgamcheck.html"},"summary":"检查匹配指定 pattern 的模式中的表和索引，除非另有排除。此选项可指定多次。"},{"signature":{"text":"-S pattern --exclude-schema= pattern","url":"/docs/18/app-pgamcheck.html"},"summary":"排除匹配指定 pattern 的模式中的表和索引。此选项可指定多次。"},{"signature":{"text":"-t pattern --table= pattern","url":"/docs/18/app-pgamcheck.html"},"summary":"检查匹配指定 pattern 的表，除非另有排除。此选项可指定多次。"},{"signature":{"text":"-T pattern --exclude-table= pattern","url":"/docs/18/app-pgamcheck.html"},"summary":"排除匹配指定 pattern 的表。此选项可指定多次。"},{"signature":{"text":"--no-dependent-indexes","url":"/docs/18/app-pgamcheck.html"},"summary":"默认情况下，如果检查某个表，则该表上的任何 B-树索引也会一并检查，即使它们没有通过 --index 或 --relation 等选项显式选中。此选项会禁止这种行为。"},{"signature":{"text":"--no-dependent-toast","url":"/docs/18/app-pgamcheck.html"},"summary":"默认情况下，如果检查某个表，则它的 TOAST 表（如果有）也会一并检查，即使该 TOAST 表没有通过 --table 或 --relation 等选项显式选中。此选项会禁止这种行为。"},{"signature":{"text":"--no-strict-names","url":"/docs/18/app-pgamcheck.html"},"summary":"默认情况下，如果 --database 、 --table 、 --index 或 --relation 的某个参数没有匹配到任何对象，就会报致命错误。此选项会将该错误降级为警告。"},{"signature":{"text":"--exclude-toast-pointers","url":"/docs/18/app-pgamcheck.html"},"summary":"默认情况下，只要在表中遇到 TOAST 指针，就会执行查找，以确保它引用的是 TOAST 表中表面看来有效的条目。这些检查可能相当慢，可用此选项跳过。"},{"signature":{"text":"--on-error-stop","url":"/docs/18/app-pgamcheck.html"},"summary":"在某个表中发现损坏后，在报告完该表第一个损坏页面上的全部损坏后，停止处理该表关系并转到下一个表或索引。"},{"signature":{"text":"--skip= option","url":"/docs/18/app-pgamcheck.html"},"summary":"如果给定 all-frozen ，表损坏检查会跳过所有表中标记为全冻结的页面。"},{"signature":{"text":"--startblock= block","url":"/docs/18/app-pgamcheck.html"},"summary":"从指定块号开始检查。如果被检查的表关系块数少于这个数字，将发生错误。此选项不适用于索引，而且大概只在检查单个表关系时才有用。进一步的注意事项见 --endblock 。"},{"signature":{"text":"--endblock= block","url":"/docs/18/app-pgamcheck.html"},"summary":"在指定块号结束检查。如果被检查的表关系块数少于这个数字，将发生错误。此选项不适用于索引，而且大概只在检查单个表关系时才有用。如果同时检查普通表和 TOAST 表，此选项会同时作用于两者；但在验证 TOAST 指针时，仍可能访问更高编号的 TOAST 块，除非使用 --exclude-toast-pointers 抑制这一行为。"},{"signature":{"text":"--checkunique","url":"/docs/18/app-pgamcheck.html"},"summary":"对于检查的每个带唯一约束的索引，使用 amcheck 的 checkunique 选项，验证重复条目中在索引里可见的项不超过一个。"},{"signature":{"text":"--heapallindexed","url":"/docs/18/app-pgamcheck.html"},"summary":"对于检查的每个索引，使用 amcheck 的 heapallindexed 选项，验证所有堆元组都以索引元组的形式出现在该索引中。"},{"signature":{"text":"--parent-check","url":"/docs/18/app-pgamcheck.html"},"summary":"对于检查的每个 B-树索引，使用 amcheck 的 bt_index_parent_check 函数，该函数会在索引检查期间额外检查父子关系。"},{"signature":{"text":"--rootdescend","url":"/docs/18/app-pgamcheck.html"},"summary":"对于检查的每个索引，使用 amcheck 的 rootdescend 选项，为每个元组从根页重新执行一次搜索，从而在叶级重新找到这些元组。"},{"signature":{"text":"-h hostname --host= hostname","url":"/docs/18/app-pgamcheck.html"},"summary":"指定服务器所在机器的主机名。如果该值以斜杠开头，则将其用作 Unix 域套接字所在的目录。"},{"signature":{"text":"-p port --port= port","url":"/docs/18/app-pgamcheck.html"},"summary":"指定服务器监听连接的 TCP 端口或本地 Unix 域套接字文件扩展名。"},{"signature":{"text":"-U --username= username","url":"/docs/18/app-pgamcheck.html"},"summary":"连接时使用的用户名。"},{"signature":{"text":"-w --no-password","url":"/docs/18/app-pgamcheck.html"},"summary":"永不发出密码提示。如果服务器要求密码认证，而又无法通过其他方式获取密码，例如通过 .pgpass 文件，则连接尝试会失败。此选项可用于没有用户在场输入密码的批处理作业和脚本。"},{"signature":{"text":"-W --password","url":"/docs/18/app-pgamcheck.html"},"summary":"强制 pg_amcheck 在连接数据库前提示输入密码。"},{"signature":{"text":"--maintenance-db= dbname","url":"/docs/18/app-pgamcheck.html"},"summary":"指定一个数据库或 连接字符串 ，用于确定待检查的数据库列表。如果既未使用 --all ，也未使用任何包含数据库名称匹配模式的选项，则不需要这样的连接，此选项也不起作用。否则，此选项值中除数据库名之外的任何连接字符串参数，在连接待检查的数据库时也会一并使用。如果省略此选项，默认值为 postgres ；若失败，则为 template1 。"},{"signature":{"text":"-e --echo","url":"/docs/18/app-pgamcheck.html"},"summary":"将发送到服务器的所有 SQL 回显到标准输出。"},{"signature":{"text":"-j num --jobs= num","url":"/docs/18/app-pgamcheck.html"},"summary":"使用 num 个到服务器的并发连接，或者为每个待检查对象使用一个连接，以较小者为准。"},{"signature":{"text":"-P --progress","url":"/docs/18/app-pgamcheck.html"},"summary":"显示进度信息。进度信息包括已完成检查的关系数量及其总大小，也包括最终将要检查的关系总数及这些关系的估计大小。"},{"signature":{"text":"-v --verbose","url":"/docs/18/app-pgamcheck.html"},"summary":"打印更多消息。特别是，它会为每个正在检查的关系打印一条消息，并提高服务器错误显示的详细程度。"},{"signature":{"text":"-V --version","url":"/docs/18/app-pgamcheck.html"},"summary":"打印 pg_amcheck 版本并退出。"},{"signature":{"text":"--install-missing --install-missing= schema","url":"/docs/18/app-pgamcheck.html"},"summary":"安装检查数据库所需的任何缺失扩展。如果某个扩展尚未安装，则其对象将安装到给定的 schema 中；如果未指定，则安装到 pg_catalog 模式中。"},{"signature":{"text":"-? --help","url":"/docs/18/app-pgamcheck.html"},"summary":"显示 pg_amcheck 命令行参数的帮助并退出。"}],"title":"手册中的选项"}],"zh_from":{"authored_translation":"source-derived-identity","body_sha256":"2af195d656c14871347e3dd1e8e5bd1fbf737cc25a0ffc5254d5f88612023a72","kind":"same-version-chinese-manual-with-source-derived-identity","manual":{"anchor":"","build_id":107,"extraction":"command-description-and-options","fragment_sha256":"fcdfc13e67fe79ec286f735d0defe24a8b10e9c04f65c555b6c7c286ebe08099","locale":"zh-Hans","page_key":"app-pgamcheck.html","source_hash":"d13f7ca0d41dc85b036d1664cb99eb825e6ba5f23339dd8ba6b17753d5bc7948","source_revision":"unknown:rendered-translation-baseline","translated_from_revision":null,"translation_revision":"git:b1b500221dbe5437cfca004d6b04d3f6e422765d;html-sha256:08e987a66af27b98444a8057c256314eafa13611a3fb9e888214fc436824244b","url":"/zh/docs/18/app-pgamcheck.html","version":"18"},"runtime_rerun":false,"source_facts_revision":"ee8d1a3612338fd9adf250730cb640fcc5233b5491337cc00a316a44e3a0b9f8"}},"ManualEvidence":{"manual_path":"app-pgamcheck.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-pgamcheck.html","label":"18.6 English manual · app-pgamcheck.html","sha256":"e27a4203de24586f422047021fddd4cd69bbe0093c3949ac283091329050c9f5","url":"/docs/18/app-pgamcheck.html"},{"anchor":"","file":"reference-client.html","label":"Client applications inventory","sha256":"68f726af77272fe73a827be2b7b5958d0f2239a6f8ed44264e9d42496bfa4fd0","url":"/docs/18/reference-client.html"}]},"MeasuredEvidence":{}},"Text":{"Collection":"tool","Key":"pg-amcheck","SourceDatabase":"center","Version":"18","Locale":"en","Title":"pg_amcheck","Summary":"pg_amcheck — checks for corruption in one or more PostgreSQL databases","BodyHTML":"\u003cdiv\u003e\u003cdiv id=\"APP-PGAMCHECK\"\u003e\n\u003cdiv\u003e\u003c/div\u003e\n\u003cdiv\u003e\n\u003ch2\u003e\u003cspan\u003e\u003cspan\u003epg_amcheck\u003c/span\u003e\u003c/span\u003e\u003c/h2\u003e\n\u003cp\u003epg_amcheck — checks for corruption in one or more \u003cspan\u003ePostgreSQL\u003c/span\u003e databases\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.9.4.1\"\u003e\u003ccode\u003epg_amcheck\u003c/code\u003e [\u003cem\u003e\u003ccode\u003eoption\u003c/code\u003e\u003c/em\u003e...] [\u003cem\u003e\u003ccode\u003edbname\u003c/code\u003e\u003c/em\u003e]\u003c/p\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv id=\"id-1.9.4.9.5\"\u003e\n\u003ch2\u003eDescription\u003c/h2\u003e\n\u003cp\u003e\u003cspan\u003epg_amcheck\u003c/span\u003e supports running \u003ca href=\"/docs/18/amcheck.html\" rel=\"nofollow\"\u003eamcheck\u003c/a\u003e\u0026#39;s corruption checking functions against one or more databases, with options to select which schemas, tables and indexes to check, which kinds of checking to perform, and whether to perform the checks in parallel, and if so, the number of parallel connections to establish and use.\u003c/p\u003e\n\u003cp\u003eOnly ordinary and toast table relations, materialized views, sequences, and btree indexes are currently supported. Other relation types are silently skipped.\u003c/p\u003e\n\u003cp\u003eIf \u003ccode\u003edbname\u003c/code\u003e is specified, it should be the name of a single database to check, and no other database selection options should be present. Otherwise, if any database selection options are present, all matching databases will be checked. If no such options are present, the default database will be checked. Database selection options include \u003ccode\u003e--all\u003c/code\u003e, \u003ccode\u003e--database\u003c/code\u003e and \u003ccode\u003e--exclude-database\u003c/code\u003e. They also include \u003ccode\u003e--relation\u003c/code\u003e, \u003ccode\u003e--exclude-relation\u003c/code\u003e, \u003ccode\u003e--table\u003c/code\u003e, \u003ccode\u003e--exclude-table\u003c/code\u003e, \u003ccode\u003e--index\u003c/code\u003e, and \u003ccode\u003e--exclude-index\u003c/code\u003e, but only when such options are used with a three-part pattern (e.g. \u003ccode\u003emydb*.myschema*.myrel*\u003c/code\u003e). Finally, they include \u003ccode\u003e--schema\u003c/code\u003e and \u003ccode\u003e--exclude-schema\u003c/code\u003e when such options are used with a two-part pattern (e.g. \u003ccode\u003emydb*.myschema*\u003c/code\u003e).\u003c/p\u003e\n\u003cp\u003e\u003cem\u003e\u003ccode\u003edbname\u003c/code\u003e\u003c/em\u003e can also be a \u003ca href=\"/docs/18/libpq-connect.html#LIBPQ-CONNSTRING\" rel=\"nofollow\"\u003econnection string\u003c/a\u003e.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv id=\"id-1.9.4.9.6\"\u003e\n\u003ch2\u003eOptions\u003c/h2\u003e\n\u003cp\u003eThe following command-line options control what is checked:\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--all\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eCheck all databases, except for any excluded via \u003ccode\u003e--exclude-database\u003c/code\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-d \u003cem\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--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\u003eCheck databases matching the specified \u003ca href=\"/docs/18/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\" rel=\"nofollow\"\u003e\u003cem\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/a\u003e, except for any excluded by \u003ccode\u003e--exclude-database\u003c/code\u003e. This option can be specified more than once.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-D \u003cem\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\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\u003eExclude databases matching the given \u003ca href=\"/docs/18/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\" rel=\"nofollow\"\u003e\u003cem\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/a\u003e. This option can be specified more than once.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-i \u003cem\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--index=\u003cem\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eCheck indexes matching the specified \u003ca href=\"/docs/18/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\" rel=\"nofollow\"\u003e\u003cem\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/a\u003e, unless they are otherwise excluded. This option can be specified more than once.\u003c/p\u003e\n\u003cp\u003eThis is similar to the \u003ccode\u003e--relation\u003c/code\u003e option, except that it applies only to indexes, not to other relation types.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-I \u003cem\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--exclude-index=\u003cem\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eExclude indexes matching the specified \u003ca href=\"/docs/18/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\" rel=\"nofollow\"\u003e\u003cem\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/a\u003e. This option can be specified more than once.\u003c/p\u003e\n\u003cp\u003eThis is similar to the \u003ccode\u003e--exclude-relation\u003c/code\u003e option, except that it applies only to indexes, not other relation types.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-r \u003cem\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--relation=\u003cem\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eCheck relations matching the specified \u003ca href=\"/docs/18/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\" rel=\"nofollow\"\u003e\u003cem\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/a\u003e, unless they are otherwise excluded. This option can be specified more than once.\u003c/p\u003e\n\u003cp\u003ePatterns may be unqualified, e.g. \u003ccode\u003emyrel*\u003c/code\u003e, or they may be schema-qualified, e.g. \u003ccode\u003emyschema*.myrel*\u003c/code\u003e or database-qualified and schema-qualified, e.g. \u003ccode\u003emydb*.myschema*.myrel*\u003c/code\u003e. A database-qualified pattern will add matching databases to the list of databases to be checked.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-R \u003cem\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--exclude-relation=\u003cem\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eExclude relations matching the specified \u003ca href=\"/docs/18/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\" rel=\"nofollow\"\u003e\u003cem\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/a\u003e. This option can be specified more than once.\u003c/p\u003e\n\u003cp\u003eAs with \u003ccode\u003e--relation\u003c/code\u003e, the \u003ca href=\"/docs/18/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\" rel=\"nofollow\"\u003e\u003cem\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/a\u003e may be unqualified, schema-qualified, or database- and schema-qualified.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-s \u003cem\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--schema=\u003cem\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eCheck tables and indexes in schemas matching the specified \u003ca href=\"/docs/18/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\" rel=\"nofollow\"\u003e\u003cem\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/a\u003e, unless they are otherwise excluded. This option can be specified more than once.\u003c/p\u003e\n\u003cp\u003eTo select only tables in schemas matching a particular pattern, consider using something like \u003ccode\u003e--table=SCHEMAPAT.* --no-dependent-indexes\u003c/code\u003e. To select only indexes, consider using something like \u003ccode\u003e--index=SCHEMAPAT.*\u003c/code\u003e.\u003c/p\u003e\n\u003cp\u003eA schema pattern may be database-qualified. For example, you may write \u003ccode\u003e--schema=mydb*.myschema*\u003c/code\u003e to select schemas matching \u003ccode\u003emyschema*\u003c/code\u003e in databases matching \u003ccode\u003emydb*\u003c/code\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-S \u003cem\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--exclude-schema=\u003cem\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eExclude tables and indexes in schemas matching the specified \u003ca href=\"/docs/18/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\" rel=\"nofollow\"\u003e\u003cem\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/a\u003e. This option can be specified more than once.\u003c/p\u003e\n\u003cp\u003eAs with \u003ccode\u003e--schema\u003c/code\u003e, the pattern may be database-qualified.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-t \u003cem\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--table=\u003cem\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eCheck tables matching the specified \u003ca href=\"/docs/18/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\" rel=\"nofollow\"\u003e\u003cem\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/a\u003e, unless they are otherwise excluded. This option can be specified more than once.\u003c/p\u003e\n\u003cp\u003eThis is similar to the \u003ccode\u003e--relation\u003c/code\u003e option, except that it applies only to tables, materialized views, and sequences, not to indexes.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-T \u003cem\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--exclude-table=\u003cem\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eExclude tables matching the specified \u003ca href=\"/docs/18/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\" rel=\"nofollow\"\u003e\u003cem\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/a\u003e. This option can be specified more than once.\u003c/p\u003e\n\u003cp\u003eThis is similar to the \u003ccode\u003e--exclude-relation\u003c/code\u003e option, except that it applies only to tables, materialized views, and sequences, not to indexes.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--no-dependent-indexes\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eBy 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 \u003ccode\u003e--index\u003c/code\u003e or \u003ccode\u003e--relation\u003c/code\u003e. This option suppresses that behavior.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--no-dependent-toast\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eBy 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 \u003ccode\u003e--table\u003c/code\u003e or \u003ccode\u003e--relation\u003c/code\u003e. This option suppresses that behavior.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--no-strict-names\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eBy default, if an argument to \u003ccode\u003e--database\u003c/code\u003e, \u003ccode\u003e--table\u003c/code\u003e, \u003ccode\u003e--index\u003c/code\u003e, or \u003ccode\u003e--relation\u003c/code\u003e matches no objects, it is a fatal error. This option downgrades that error to a warning.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003cp\u003eThe following command-line options control checking of tables:\u003c/p\u003e\n\u003cdiv\u003e\n\u003cdl\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--exclude-toast-pointers\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eBy 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.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--on-error-stop\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eAfter 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.\u003c/p\u003e\n\u003cp\u003eNote that index checking always stops after the first corrupt page. This option only has meaning relative to table relations.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--skip=\u003cem\u003e\u003ccode\u003eoption\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eIf \u003ccode\u003eall-frozen\u003c/code\u003e is given, table corruption checks will skip over pages in all tables that are marked as all frozen.\u003c/p\u003e\n\u003cp\u003eIf \u003ccode\u003eall-visible\u003c/code\u003e is given, table corruption checks will skip over pages in all tables that are marked as all visible.\u003c/p\u003e\n\u003cp\u003eBy default, no pages are skipped. This can be specified as \u003ccode\u003enone\u003c/code\u003e, but since this is the default, it need not be mentioned.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--startblock=\u003cem\u003e\u003ccode\u003eblock\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eStart 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 \u003ccode\u003e--endblock\u003c/code\u003e for further caveats.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--endblock=\u003cem\u003e\u003ccode\u003eblock\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eEnd 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 \u003ccode\u003e--exclude-toast-pointers\u003c/code\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003cp\u003eThe following command-line options control checking of B-tree indexes:\u003c/p\u003e\n\u003cdiv\u003e\n\u003cdl\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--checkunique\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eFor each index with unique constraint checked, verify that no more than one among duplicate entries is visible in the index using \u003ca href=\"/docs/18/amcheck.html\" rel=\"nofollow\"\u003eamcheck\u003c/a\u003e\u0026#39;s \u003ccode\u003echeckunique\u003c/code\u003e option.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--heapallindexed\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eFor each index checked, verify the presence of all heap tuples as index tuples in the index using \u003ca href=\"/docs/18/amcheck.html\" rel=\"nofollow\"\u003eamcheck\u003c/a\u003e\u0026#39;s \u003ccode\u003eheapallindexed\u003c/code\u003e option.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--parent-check\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eFor each btree index checked, use \u003ca href=\"/docs/18/amcheck.html\" rel=\"nofollow\"\u003eamcheck\u003c/a\u003e\u0026#39;s \u003ccode\u003ebt_index_parent_check\u003c/code\u003e function, which performs additional checks of parent/child relationships during index checking.\u003c/p\u003e\n\u003cp\u003eThe default is to use \u003cspan\u003eamcheck\u003c/span\u003e\u0026#39;s \u003ccode\u003ebt_index_check\u003c/code\u003e function, but note that use of the \u003ccode\u003e--rootdescend\u003c/code\u003e option implicitly selects \u003ccode\u003ebt_index_parent_check\u003c/code\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--rootdescend\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eFor each index checked, re-find tuples on the leaf level by performing a new search from the root page for each tuple using \u003ca href=\"/docs/18/amcheck.html\" rel=\"nofollow\"\u003eamcheck\u003c/a\u003e\u0026#39;s \u003ccode\u003erootdescend\u003c/code\u003e option.\u003c/p\u003e\n\u003cp\u003eUse of this option implicitly also selects the \u003ccode\u003e--parent-check\u003c/code\u003e option.\u003c/p\u003e\n\u003cp\u003eThis 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.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003cdiv\u003e\n\u003ch3\u003eWarning\u003c/h3\u003e\n\u003cp\u003eThe extra checks performed against B-tree indexes when the \u003ccode\u003e--parent-check\u003c/code\u003e option or the \u003ccode\u003e--rootdescend\u003c/code\u003e option is specified require relatively strong relation-level locks. These checks are the only checks that will block concurrent data modification from \u003ccode\u003eINSERT\u003c/code\u003e, \u003ccode\u003eUPDATE\u003c/code\u003e, and \u003ccode\u003eDELETE\u003c/code\u003e commands.\u003c/p\u003e\n\u003c/div\u003e\n\u003cp\u003eThe following command-line options control the connection to the server:\u003c/p\u003e\n\u003cdiv\u003e\n\u003cdl\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-h \u003cem\u003e\u003ccode\u003ehostname\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--host=\u003cem\u003e\u003ccode\u003ehostname\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 server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket.\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.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-U\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_amcheck\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_amcheck\u003c/span\u003e will automatically prompt for a password if the server demands password authentication. However, \u003cspan\u003epg_amcheck\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\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--maintenance-db=\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 a database or \u003ca href=\"/docs/18/libpq-connect.html#LIBPQ-CONNSTRING\" rel=\"nofollow\"\u003econnection string\u003c/a\u003e to be used to discover the list of databases to be checked. If neither \u003ccode\u003e--all\u003c/code\u003e 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 \u003ccode\u003epostgres\u003c/code\u003e or, if that fails, \u003ccode\u003etemplate1\u003c/code\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003cp\u003eOther options are also available:\u003c/p\u003e\n\u003cdiv\u003e\n\u003cdl\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--echo\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eEcho to stdout all SQL sent to the server.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-j \u003cem\u003e\u003ccode\u003enum\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--jobs=\u003cem\u003e\u003ccode\u003enum\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eUse \u003cem\u003e\u003ccode\u003enum\u003c/code\u003e\u003c/em\u003e concurrent connections to the server, or one per object to be checked, whichever is less.\u003c/p\u003e\n\u003cp\u003eThe default is to use a single connection.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-P\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--progress\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eShow 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.\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\u003ePrint 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.\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_amcheck\u003c/span\u003e version and exit.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--install-missing\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--install-missing=\u003cem\u003e\u003ccode\u003eschema\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eInstall any missing extensions that are required to check the database(s). If not yet installed, each extension\u0026#39;s objects will be installed into the given \u003cem\u003e\u003ccode\u003eschema\u003c/code\u003e\u003c/em\u003e, or if not specified into schema \u003ccode\u003epg_catalog\u003c/code\u003e.\u003c/p\u003e\n\u003cp\u003eAt present, the only required extension is \u003ca href=\"/docs/18/amcheck.html\" rel=\"nofollow\"\u003eamcheck\u003c/a\u003e.\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_amcheck\u003c/span\u003e command line arguments, and exit.\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.9.7\"\u003e\n\u003ch2\u003eEnvironment\u003c/h2\u003e\n\u003cp\u003e\u003ccode\u003epg_amcheck\u003c/code\u003e, 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\u003cp\u003eThe environment variable \u003ccode\u003ePG_COLOR\u003c/code\u003e specifies 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/div\u003e\n\u003cdiv id=\"id-1.9.4.9.8\"\u003e\n\u003ch2\u003eNotes\u003c/h2\u003e\n\u003cp\u003e\u003cspan\u003epg_amcheck\u003c/span\u003e is designed to work with \u003cspan\u003ePostgreSQL\u003c/span\u003e 14.0 and later.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv id=\"id-1.9.4.9.9\"\u003e\n\u003ch2\u003eSee Also\u003c/h2\u003e\u003cspan\u003e\u003ca href=\"/docs/18/amcheck.html\" rel=\"nofollow\"\u003eamcheck\u003c/a\u003e\u003c/span\u003e\n\u003c/div\u003e\n\u003c/div\u003e\u003c/div\u003e","SourceRevision":"ee8d1a3612338fd9adf250730cb640fcc5233b5491337cc00a316a44e3a0b9f8","ContentHash":"bb6e3e9585270840d1e603daeccc1cf75fbe9471801c8dcc456320b193ee59fc","Payload":{"description":["pg_amcheck — checks for corruption in one or more PostgreSQL databases"],"manual_html":"\u003cdiv\u003e\u003cdiv class=\"refentry\" id=\"APP-PGAMCHECK\"\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_amcheck\u003c/span\u003e\u003c/span\u003e\u003c/h2\u003e\n\u003cp\u003epg_amcheck — checks for corruption in one or more \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e databases\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.9.4.1\"\u003e\u003ccode class=\"command\"\u003epg_amcheck\u003c/code\u003e [\u003cem class=\"replaceable\"\u003e\u003ccode\u003eoption\u003c/code\u003e\u003c/em\u003e...] [\u003cem class=\"replaceable\"\u003e\u003ccode\u003edbname\u003c/code\u003e\u003c/em\u003e]\u003c/p\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.4.9.5\"\u003e\n\u003ch2\u003eDescription\u003c/h2\u003e\n\u003cp\u003e\u003cspan class=\"application\"\u003epg_amcheck\u003c/span\u003e supports running \u003ca class=\"xref\" href=\"/docs/18/amcheck.html\" title=\"F.1. amcheck — tools to verify table and index consistency\"\u003eamcheck\u003c/a\u003e's corruption checking functions against one or more databases, with options to select which schemas, tables and indexes to check, which kinds of checking to perform, and whether to perform the checks in parallel, and if so, the number of parallel connections to establish and use.\u003c/p\u003e\n\u003cp\u003eOnly ordinary and toast table relations, materialized views, sequences, and btree indexes are currently supported. Other relation types are silently skipped.\u003c/p\u003e\n\u003cp\u003eIf \u003ccode class=\"literal\"\u003edbname\u003c/code\u003e is specified, it should be the name of a single database to check, and no other database selection options should be present. Otherwise, if any database selection options are present, all matching databases will be checked. If no such options are present, the default database will be checked. Database selection options include \u003ccode class=\"option\"\u003e--all\u003c/code\u003e, \u003ccode class=\"option\"\u003e--database\u003c/code\u003e and \u003ccode class=\"option\"\u003e--exclude-database\u003c/code\u003e. They also include \u003ccode class=\"option\"\u003e--relation\u003c/code\u003e, \u003ccode class=\"option\"\u003e--exclude-relation\u003c/code\u003e, \u003ccode class=\"option\"\u003e--table\u003c/code\u003e, \u003ccode class=\"option\"\u003e--exclude-table\u003c/code\u003e, \u003ccode class=\"option\"\u003e--index\u003c/code\u003e, and \u003ccode class=\"option\"\u003e--exclude-index\u003c/code\u003e, but only when such options are used with a three-part pattern (e.g. \u003ccode class=\"option\"\u003emydb*.myschema*.myrel*\u003c/code\u003e). Finally, they include \u003ccode class=\"option\"\u003e--schema\u003c/code\u003e and \u003ccode class=\"option\"\u003e--exclude-schema\u003c/code\u003e when such options are used with a two-part pattern (e.g. \u003ccode class=\"option\"\u003emydb*.myschema*\u003c/code\u003e).\u003c/p\u003e\n\u003cp\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003edbname\u003c/code\u003e\u003c/em\u003e can also be a \u003ca class=\"link\" href=\"/docs/18/libpq-connect.html#LIBPQ-CONNSTRING\" title=\"32.1.1. Connection Strings\"\u003econnection string\u003c/a\u003e.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.4.9.6\"\u003e\n\u003ch2\u003eOptions\u003c/h2\u003e\n\u003cp\u003eThe following command-line options control what is checked:\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--all\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eCheck all databases, except for any excluded via \u003ccode class=\"option\"\u003e--exclude-database\u003c/code\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-d \u003cem class=\"replaceable\"\u003e\u003ccode\u003epattern\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\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eCheck databases matching the specified \u003ca class=\"link\" href=\"/docs/18/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/a\u003e, except for any excluded by \u003ccode class=\"option\"\u003e--exclude-database\u003c/code\u003e. This option can be specified more than once.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-D \u003cem class=\"replaceable\"\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\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\u003eExclude databases matching the given \u003ca class=\"link\" href=\"/docs/18/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/a\u003e. This option can be specified more than once.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-i \u003cem class=\"replaceable\"\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--index=\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\u003eCheck indexes matching the specified \u003ca class=\"link\" href=\"/docs/18/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/a\u003e, unless they are otherwise excluded. This option can be specified more than once.\u003c/p\u003e\n\u003cp\u003eThis is similar to the \u003ccode class=\"option\"\u003e--relation\u003c/code\u003e option, except that it applies only to indexes, not to other relation types.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-I \u003cem class=\"replaceable\"\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--exclude-index=\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\u003eExclude indexes matching the specified \u003ca class=\"link\" href=\"/docs/18/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/a\u003e. This option can be specified more than once.\u003c/p\u003e\n\u003cp\u003eThis is similar to the \u003ccode class=\"option\"\u003e--exclude-relation\u003c/code\u003e option, except that it applies only to indexes, not other relation types.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-r \u003cem class=\"replaceable\"\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--relation=\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\u003eCheck relations matching the specified \u003ca class=\"link\" href=\"/docs/18/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/a\u003e, unless they are otherwise excluded. This option can be specified more than once.\u003c/p\u003e\n\u003cp\u003ePatterns may be unqualified, e.g. \u003ccode class=\"literal\"\u003emyrel*\u003c/code\u003e, or they may be schema-qualified, e.g. \u003ccode class=\"literal\"\u003emyschema*.myrel*\u003c/code\u003e or database-qualified and schema-qualified, e.g. \u003ccode class=\"literal\"\u003emydb*.myschema*.myrel*\u003c/code\u003e. A database-qualified pattern will add matching databases to the list of databases to be checked.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-R \u003cem class=\"replaceable\"\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--exclude-relation=\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\u003eExclude relations matching the specified \u003ca class=\"link\" href=\"/docs/18/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/a\u003e. This option can be specified more than once.\u003c/p\u003e\n\u003cp\u003eAs with \u003ccode class=\"option\"\u003e--relation\u003c/code\u003e, the \u003ca class=\"link\" href=\"/docs/18/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/a\u003e may be unqualified, schema-qualified, or database- and schema-qualified.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-s \u003cem class=\"replaceable\"\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--schema=\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\u003eCheck tables and indexes in schemas matching the specified \u003ca class=\"link\" href=\"/docs/18/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/a\u003e, unless they are otherwise excluded. This option can be specified more than once.\u003c/p\u003e\n\u003cp\u003eTo select only tables in schemas matching a particular pattern, consider using something like \u003ccode class=\"literal\"\u003e--table=SCHEMAPAT.* --no-dependent-indexes\u003c/code\u003e. To select only indexes, consider using something like \u003ccode class=\"literal\"\u003e--index=SCHEMAPAT.*\u003c/code\u003e.\u003c/p\u003e\n\u003cp\u003eA schema pattern may be database-qualified. For example, you may write \u003ccode class=\"literal\"\u003e--schema=mydb*.myschema*\u003c/code\u003e to select schemas matching \u003ccode class=\"literal\"\u003emyschema*\u003c/code\u003e in databases matching \u003ccode class=\"literal\"\u003emydb*\u003c/code\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-S \u003cem class=\"replaceable\"\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--exclude-schema=\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\u003eExclude tables and indexes in schemas matching the specified \u003ca class=\"link\" href=\"/docs/18/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/a\u003e. This option can be specified more than once.\u003c/p\u003e\n\u003cp\u003eAs with \u003ccode class=\"option\"\u003e--schema\u003c/code\u003e, the pattern may be database-qualified.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-t \u003cem class=\"replaceable\"\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--table=\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\u003eCheck tables matching the specified \u003ca class=\"link\" href=\"/docs/18/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/a\u003e, unless they are otherwise excluded. This option can be specified more than once.\u003c/p\u003e\n\u003cp\u003eThis is similar to the \u003ccode class=\"option\"\u003e--relation\u003c/code\u003e option, except that it applies only to tables, materialized views, and sequences, not to indexes.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-T \u003cem class=\"replaceable\"\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--exclude-table=\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\u003eExclude tables matching the specified \u003ca class=\"link\" href=\"/docs/18/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003epattern\u003c/code\u003e\u003c/em\u003e\u003c/a\u003e. This option can be specified more than once.\u003c/p\u003e\n\u003cp\u003eThis is similar to the \u003ccode class=\"option\"\u003e--exclude-relation\u003c/code\u003e option, except that it applies only to tables, materialized views, and sequences, not to indexes.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--no-dependent-indexes\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eBy 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 \u003ccode class=\"literal\"\u003e--index\u003c/code\u003e or \u003ccode class=\"literal\"\u003e--relation\u003c/code\u003e. This option suppresses that behavior.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--no-dependent-toast\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eBy 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 \u003ccode class=\"literal\"\u003e--table\u003c/code\u003e or \u003ccode class=\"literal\"\u003e--relation\u003c/code\u003e. This option suppresses that behavior.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--no-strict-names\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eBy default, if an argument to \u003ccode class=\"literal\"\u003e--database\u003c/code\u003e, \u003ccode class=\"literal\"\u003e--table\u003c/code\u003e, \u003ccode class=\"literal\"\u003e--index\u003c/code\u003e, or \u003ccode class=\"literal\"\u003e--relation\u003c/code\u003e matches no objects, it is a fatal error. This option downgrades that error to a warning.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003cp\u003eThe following command-line options control checking of tables:\u003c/p\u003e\n\u003cdiv class=\"variablelist\"\u003e\n\u003cdl class=\"variablelist\"\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--exclude-toast-pointers\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eBy 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.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--on-error-stop\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eAfter 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.\u003c/p\u003e\n\u003cp\u003eNote that index checking always stops after the first corrupt page. This option only has meaning relative to table relations.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--skip=\u003cem class=\"replaceable\"\u003e\u003ccode\u003eoption\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eIf \u003ccode class=\"literal\"\u003eall-frozen\u003c/code\u003e is given, table corruption checks will skip over pages in all tables that are marked as all frozen.\u003c/p\u003e\n\u003cp\u003eIf \u003ccode class=\"literal\"\u003eall-visible\u003c/code\u003e is given, table corruption checks will skip over pages in all tables that are marked as all visible.\u003c/p\u003e\n\u003cp\u003eBy default, no pages are skipped. This can be specified as \u003ccode class=\"literal\"\u003enone\u003c/code\u003e, but since this is the default, it need not be mentioned.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--startblock=\u003cem class=\"replaceable\"\u003e\u003ccode\u003eblock\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eStart 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 \u003ccode class=\"literal\"\u003e--endblock\u003c/code\u003e for further caveats.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--endblock=\u003cem class=\"replaceable\"\u003e\u003ccode\u003eblock\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eEnd 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 \u003ccode class=\"option\"\u003e--exclude-toast-pointers\u003c/code\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003cp\u003eThe following command-line options control checking of B-tree indexes:\u003c/p\u003e\n\u003cdiv class=\"variablelist\"\u003e\n\u003cdl class=\"variablelist\"\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--checkunique\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eFor each index with unique constraint checked, verify that no more than one among duplicate entries is visible in the index using \u003ca class=\"xref\" href=\"/docs/18/amcheck.html\" title=\"F.1. amcheck — tools to verify table and index consistency\"\u003eamcheck\u003c/a\u003e's \u003ccode class=\"option\"\u003echeckunique\u003c/code\u003e option.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--heapallindexed\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eFor each index checked, verify the presence of all heap tuples as index tuples in the index using \u003ca class=\"xref\" href=\"/docs/18/amcheck.html\" title=\"F.1. amcheck — tools to verify table and index consistency\"\u003eamcheck\u003c/a\u003e's \u003ccode class=\"option\"\u003eheapallindexed\u003c/code\u003e option.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--parent-check\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eFor each btree index checked, use \u003ca class=\"xref\" href=\"/docs/18/amcheck.html\" title=\"F.1. amcheck — tools to verify table and index consistency\"\u003eamcheck\u003c/a\u003e's \u003ccode class=\"function\"\u003ebt_index_parent_check\u003c/code\u003e function, which performs additional checks of parent/child relationships during index checking.\u003c/p\u003e\n\u003cp\u003eThe default is to use \u003cspan class=\"application\"\u003eamcheck\u003c/span\u003e's \u003ccode class=\"function\"\u003ebt_index_check\u003c/code\u003e function, but note that use of the \u003ccode class=\"option\"\u003e--rootdescend\u003c/code\u003e option implicitly selects \u003ccode class=\"function\"\u003ebt_index_parent_check\u003c/code\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--rootdescend\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eFor each index checked, re-find tuples on the leaf level by performing a new search from the root page for each tuple using \u003ca class=\"xref\" href=\"/docs/18/amcheck.html\" title=\"F.1. amcheck — tools to verify table and index consistency\"\u003eamcheck\u003c/a\u003e's \u003ccode class=\"option\"\u003erootdescend\u003c/code\u003e option.\u003c/p\u003e\n\u003cp\u003eUse of this option implicitly also selects the \u003ccode class=\"option\"\u003e--parent-check\u003c/code\u003e option.\u003c/p\u003e\n\u003cp\u003eThis 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.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003cdiv class=\"warning\"\u003e\n\u003ch3 class=\"title\"\u003eWarning\u003c/h3\u003e\n\u003cp\u003eThe extra checks performed against B-tree indexes when the \u003ccode class=\"option\"\u003e--parent-check\u003c/code\u003e option or the \u003ccode class=\"option\"\u003e--rootdescend\u003c/code\u003e option is specified require relatively strong relation-level locks. These checks are the only checks that will block concurrent data modification from \u003ccode class=\"command\"\u003eINSERT\u003c/code\u003e, \u003ccode class=\"command\"\u003eUPDATE\u003c/code\u003e, and \u003ccode class=\"command\"\u003eDELETE\u003c/code\u003e commands.\u003c/p\u003e\n\u003c/div\u003e\n\u003cp\u003eThe following command-line options control the connection to the server:\u003c/p\u003e\n\u003cdiv class=\"variablelist\"\u003e\n\u003cdl class=\"variablelist\"\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-h \u003cem class=\"replaceable\"\u003e\u003ccode\u003ehostname\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\u003ehostname\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 server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket.\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.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-U\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_amcheck\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_amcheck\u003c/span\u003e will automatically prompt for a password if the server demands password authentication. However, \u003cspan class=\"application\"\u003epg_amcheck\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\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--maintenance-db=\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 a database or \u003ca class=\"link\" href=\"/docs/18/libpq-connect.html#LIBPQ-CONNSTRING\" title=\"32.1.1. Connection Strings\"\u003econnection string\u003c/a\u003e to be used to discover the list of databases to be checked. If neither \u003ccode class=\"option\"\u003e--all\u003c/code\u003e 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 \u003ccode class=\"literal\"\u003epostgres\u003c/code\u003e or, if that fails, \u003ccode class=\"literal\"\u003etemplate1\u003c/code\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003cp\u003eOther options are also available:\u003c/p\u003e\n\u003cdiv class=\"variablelist\"\u003e\n\u003cdl class=\"variablelist\"\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--echo\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eEcho to stdout all SQL sent to the server.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-j \u003cem class=\"replaceable\"\u003e\u003ccode\u003enum\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--jobs=\u003cem class=\"replaceable\"\u003e\u003ccode\u003enum\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eUse \u003cem class=\"replaceable\"\u003e\u003ccode\u003enum\u003c/code\u003e\u003c/em\u003e concurrent connections to the server, or one per object to be checked, whichever is less.\u003c/p\u003e\n\u003cp\u003eThe default is to use a single connection.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-P\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--progress\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eShow 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.\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\u003ePrint 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.\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_amcheck\u003c/span\u003e version and exit.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--install-missing\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--install-missing=\u003cem class=\"replaceable\"\u003e\u003ccode\u003eschema\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eInstall 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 \u003cem class=\"replaceable\"\u003e\u003ccode\u003eschema\u003c/code\u003e\u003c/em\u003e, or if not specified into schema \u003ccode class=\"literal\"\u003epg_catalog\u003c/code\u003e.\u003c/p\u003e\n\u003cp\u003eAt present, the only required extension is \u003ca class=\"xref\" href=\"/docs/18/amcheck.html\" title=\"F.1. amcheck — tools to verify table and index consistency\"\u003eamcheck\u003c/a\u003e.\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_amcheck\u003c/span\u003e command line arguments, and exit.\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.9.7\"\u003e\n\u003ch2\u003eEnvironment\u003c/h2\u003e\n\u003cp\u003e\u003ccode class=\"command\"\u003epg_amcheck\u003c/code\u003e, 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\u003cp\u003eThe environment variable \u003ccode class=\"envar\"\u003ePG_COLOR\u003c/code\u003e specifies 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/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.4.9.8\"\u003e\n\u003ch2\u003eNotes\u003c/h2\u003e\n\u003cp\u003e\u003cspan class=\"application\"\u003epg_amcheck\u003c/span\u003e is designed to work with \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e 14.0 and later.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.4.9.9\"\u003e\n\u003ch2\u003eSee Also\u003c/h2\u003e\u003cspan class=\"simplelist\"\u003e\u003ca class=\"xref\" href=\"/docs/18/amcheck.html\" title=\"F.1. amcheck — tools to verify table and index consistency\"\u003eamcheck\u003c/a\u003e\u003c/span\u003e\n\u003c/div\u003e\n\u003c/div\u003e\u003c/div\u003e","related":[],"sections":[],"tables":[{"columns":[{"key":"signature","label":"Option and arguments"},{"key":"summary","label":"Description"}],"key":"options","rows":[{"signature":{"text":"-a --all","url":"/docs/18/app-pgamcheck.html"},"summary":"Check all databases, except for any excluded via --exclude-database ."},{"signature":{"text":"-d pattern --database= pattern","url":"/docs/18/app-pgamcheck.html"},"summary":"Check databases matching the specified pattern , except for any excluded by --exclude-database . This option can be specified more than once."},{"signature":{"text":"-D pattern --exclude-database= pattern","url":"/docs/18/app-pgamcheck.html"},"summary":"Exclude databases matching the given pattern . This option can be specified more than once."},{"signature":{"text":"-i pattern --index= pattern","url":"/docs/18/app-pgamcheck.html"},"summary":"Check indexes matching the specified pattern , unless they are otherwise excluded. This option can be specified more than once."},{"signature":{"text":"-I pattern --exclude-index= pattern","url":"/docs/18/app-pgamcheck.html"},"summary":"Exclude indexes matching the specified pattern . This option can be specified more than once."},{"signature":{"text":"-r pattern --relation= pattern","url":"/docs/18/app-pgamcheck.html"},"summary":"Check relations matching the specified pattern , unless they are otherwise excluded. This option can be specified more than once."},{"signature":{"text":"-R pattern --exclude-relation= pattern","url":"/docs/18/app-pgamcheck.html"},"summary":"Exclude relations matching the specified pattern . This option can be specified more than once."},{"signature":{"text":"-s pattern --schema= pattern","url":"/docs/18/app-pgamcheck.html"},"summary":"Check tables and indexes in schemas matching the specified pattern , unless they are otherwise excluded. This option can be specified more than once."},{"signature":{"text":"-S pattern --exclude-schema= pattern","url":"/docs/18/app-pgamcheck.html"},"summary":"Exclude tables and indexes in schemas matching the specified pattern . This option can be specified more than once."},{"signature":{"text":"-t pattern --table= pattern","url":"/docs/18/app-pgamcheck.html"},"summary":"Check tables matching the specified pattern , unless they are otherwise excluded. This option can be specified more than once."},{"signature":{"text":"-T pattern --exclude-table= pattern","url":"/docs/18/app-pgamcheck.html"},"summary":"Exclude tables matching the specified pattern . This option can be specified more than once."},{"signature":{"text":"--no-dependent-indexes","url":"/docs/18/app-pgamcheck.html"},"summary":"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."},{"signature":{"text":"--no-dependent-toast","url":"/docs/18/app-pgamcheck.html"},"summary":"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."},{"signature":{"text":"--no-strict-names","url":"/docs/18/app-pgamcheck.html"},"summary":"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."},{"signature":{"text":"--exclude-toast-pointers","url":"/docs/18/app-pgamcheck.html"},"summary":"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."},{"signature":{"text":"--on-error-stop","url":"/docs/18/app-pgamcheck.html"},"summary":"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."},{"signature":{"text":"--skip= option","url":"/docs/18/app-pgamcheck.html"},"summary":"If all-frozen is given, table corruption checks will skip over pages in all tables that are marked as all frozen."},{"signature":{"text":"--startblock= block","url":"/docs/18/app-pgamcheck.html"},"summary":"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."},{"signature":{"text":"--endblock= block","url":"/docs/18/app-pgamcheck.html"},"summary":"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 ."},{"signature":{"text":"--checkunique","url":"/docs/18/app-pgamcheck.html"},"summary":"For each index with unique constraint checked, verify that no more than one among duplicate entries is visible in the index using amcheck 's checkunique option."},{"signature":{"text":"--heapallindexed","url":"/docs/18/app-pgamcheck.html"},"summary":"For each index checked, verify the presence of all heap tuples as index tuples in the index using amcheck 's heapallindexed option."},{"signature":{"text":"--parent-check","url":"/docs/18/app-pgamcheck.html"},"summary":"For each btree index checked, use amcheck 's bt_index_parent_check function, which performs additional checks of parent/child relationships during index checking."},{"signature":{"text":"--rootdescend","url":"/docs/18/app-pgamcheck.html"},"summary":"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."},{"signature":{"text":"-h hostname --host= hostname","url":"/docs/18/app-pgamcheck.html"},"summary":"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."},{"signature":{"text":"-p port --port= port","url":"/docs/18/app-pgamcheck.html"},"summary":"Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections."},{"signature":{"text":"-U --username= username","url":"/docs/18/app-pgamcheck.html"},"summary":"User name to connect as."},{"signature":{"text":"-w --no-password","url":"/docs/18/app-pgamcheck.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-pgamcheck.html"},"summary":"Force pg_amcheck to prompt for a password before connecting to a database."},{"signature":{"text":"--maintenance-db= dbname","url":"/docs/18/app-pgamcheck.html"},"summary":"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 ."},{"signature":{"text":"-e --echo","url":"/docs/18/app-pgamcheck.html"},"summary":"Echo to stdout all SQL sent to the server."},{"signature":{"text":"-j num --jobs= num","url":"/docs/18/app-pgamcheck.html"},"summary":"Use num concurrent connections to the server, or one per object to be checked, whichever is less."},{"signature":{"text":"-P --progress","url":"/docs/18/app-pgamcheck.html"},"summary":"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."},{"signature":{"text":"-v --verbose","url":"/docs/18/app-pgamcheck.html"},"summary":"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."},{"signature":{"text":"-V --version","url":"/docs/18/app-pgamcheck.html"},"summary":"Print the pg_amcheck version and exit."},{"signature":{"text":"--install-missing --install-missing= schema","url":"/docs/18/app-pgamcheck.html"},"summary":"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 ."},{"signature":{"text":"-? --help","url":"/docs/18/app-pgamcheck.html"},"summary":"Show help about pg_amcheck command line arguments, and exit."}],"title":"Documented options"}]}},"RequestedLocale":"en","Fallback":false,"Versions":["14","15","16","17","18","19","20"],"Locales":["en","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
