{"Entry":{"collection":"tool","key":"pg-amcheck","name":"pg_amcheck","aliases":["pg_amcheck"],"metadata":{"aliases":["pg_amcheck"],"category":"Client applications","content_hash":"0bcf8db7e2f3740e119ff65b165f5e8887107fb6da5ebe1dad682b050946e109","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"],"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"}],"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":[],"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"}]},"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":"zh-Hans","Fallback":true,"Versions":["14","15","16","17","18","19","20"],"Locales":["en"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
