{"kind": "tool", "major": "18", "item": {"slug": "pg-amcheck", "name": "pg_amcheck", "name_zh": "", "category": "Client applications", "summary": "pg_amcheck \u2014 checks for corruption in one or more PostgreSQL databases", "aliases": ["pg_amcheck"], "content_hash": "0bcf8db7e2f3740e119ff65b165f5e8887107fb6da5ebe1dad682b050946e109", "versions": {"14": {"facts": [{"label": "Documented executable", "value": "pg_amcheck"}, {"label": "Executable version", "value": "14.24"}, {"label": "Reference inventory", "value": "Client applications"}, {"label": "Option definition groups", "value": "35"}], "tables": [{"key": "options", "rows": [{"summary": "Check all databases, except for any excluded via --exclude-database .", "signature": {"url": "/docs/14/app-pgamcheck.html", "text": "-a --all"}}, {"summary": "Check databases matching the specified pattern , except for any excluded by --exclude-database . This option can be specified more than once.", "signature": {"url": "/docs/14/app-pgamcheck.html", "text": "-d pattern --database= pattern"}}, {"summary": "Exclude databases matching the given pattern . This option can be specified more than once.", "signature": {"url": "/docs/14/app-pgamcheck.html", "text": "-D pattern --exclude-database= pattern"}}, {"summary": "Check indexes matching the specified pattern , unless they are otherwise excluded. This option can be specified more than once.", "signature": {"url": "/docs/14/app-pgamcheck.html", "text": "-i pattern --index= pattern"}}, {"summary": "Exclude indexes matching the specified pattern . This option can be specified more than once.", "signature": {"url": "/docs/14/app-pgamcheck.html", "text": "-I pattern --exclude-index= pattern"}}, {"summary": "Check relations matching the specified pattern , unless they are otherwise excluded. This option can be specified more than once.", "signature": {"url": "/docs/14/app-pgamcheck.html", "text": "-r pattern --relation= pattern"}}, {"summary": "Exclude relations matching the specified pattern . This option can be specified more than once.", "signature": {"url": "/docs/14/app-pgamcheck.html", "text": "-R pattern --exclude-relation= pattern"}}, {"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": {"url": "/docs/14/app-pgamcheck.html", "text": "-s pattern --schema= pattern"}}, {"summary": "Exclude tables and indexes in schemas matching the specified pattern . This option can be specified more than once.", "signature": {"url": "/docs/14/app-pgamcheck.html", "text": "-S pattern --exclude-schema= pattern"}}, {"summary": "Check tables matching the specified pattern , unless they are otherwise excluded. This option can be specified more than once.", "signature": {"url": "/docs/14/app-pgamcheck.html", "text": "-t pattern --table= pattern"}}, {"summary": "Exclude tables matching the specified pattern . This option can be specified more than once.", "signature": {"url": "/docs/14/app-pgamcheck.html", "text": "-T pattern --exclude-table= pattern"}}, {"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": {"url": "/docs/14/app-pgamcheck.html", "text": "--no-dependent-indexes"}}, {"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": {"url": "/docs/14/app-pgamcheck.html", "text": "--no-dependent-toast"}}, {"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": {"url": "/docs/14/app-pgamcheck.html", "text": "--no-strict-names"}}, {"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": {"url": "/docs/14/app-pgamcheck.html", "text": "--exclude-toast-pointers"}}, {"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": {"url": "/docs/14/app-pgamcheck.html", "text": "--on-error-stop"}}, {"summary": "If all-frozen is given, table corruption checks will skip over pages in all tables that are marked as all frozen.", "signature": {"url": "/docs/14/app-pgamcheck.html", "text": "--skip= option"}}, {"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": {"url": "/docs/14/app-pgamcheck.html", "text": "--startblock= block"}}, {"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": {"url": "/docs/14/app-pgamcheck.html", "text": "--endblock= block"}}, {"summary": "For each index checked, verify the presence of all heap tuples as index tuples in the index using amcheck 's heapallindexed option.", "signature": {"url": "/docs/14/app-pgamcheck.html", "text": "--heapallindexed"}}, {"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": {"url": "/docs/14/app-pgamcheck.html", "text": "--parent-check"}}, {"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": {"url": "/docs/14/app-pgamcheck.html", "text": "--rootdescend"}}, {"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": {"url": "/docs/14/app-pgamcheck.html", "text": "-h hostname --host= hostname"}}, {"summary": "Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections.", "signature": {"url": "/docs/14/app-pgamcheck.html", "text": "-p port --port= port"}}, {"summary": "User name to connect as.", "signature": {"url": "/docs/14/app-pgamcheck.html", "text": "-U --username= username"}}, {"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": {"url": "/docs/14/app-pgamcheck.html", "text": "-w --no-password"}}, {"summary": "Force pg_amcheck to prompt for a password before connecting to a database.", "signature": {"url": "/docs/14/app-pgamcheck.html", "text": "-W --password"}}, {"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": {"url": "/docs/14/app-pgamcheck.html", "text": "--maintenance-db= dbname"}}, {"summary": "Echo to stdout all SQL sent to the server.", "signature": {"url": "/docs/14/app-pgamcheck.html", "text": "-e --echo"}}, {"summary": "Use num concurrent connections to the server, or one per object to be checked, whichever is less.", "signature": {"url": "/docs/14/app-pgamcheck.html", "text": "-j num --jobs= num"}}, {"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": {"url": "/docs/14/app-pgamcheck.html", "text": "-P --progress"}}, {"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": {"url": "/docs/14/app-pgamcheck.html", "text": "-v --verbose"}}, {"summary": "Print the pg_amcheck version and exit.", "signature": {"url": "/docs/14/app-pgamcheck.html", "text": "-V --version"}}, {"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": {"url": "/docs/14/app-pgamcheck.html", "text": "--install-missing --install-missing= schema"}}, {"summary": "Show help about pg_amcheck command line arguments, and exit.", "signature": {"url": "/docs/14/app-pgamcheck.html", "text": "-? --help"}}], "title": "Documented options", "columns": [{"key": "signature", "label": "Option and arguments"}, {"key": "summary", "label": "Description"}]}], "options": [{"names": ["-a", "--all"], "summary": "Check all databases, except for any excluded via --exclude-database .", "signature": "-a --all", "source_url": "/docs/14/app-pgamcheck.html", "description": "Check all databases, except for any excluded via --exclude-database ."}, {"names": ["-d pattern", "--database= pattern"], "summary": "Check databases matching the specified pattern , except for any excluded by --exclude-database . This option can be specified more than once.", "signature": "-d pattern --database= pattern", "source_url": "/docs/14/app-pgamcheck.html", "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", "--exclude-database= pattern"], "summary": "Exclude databases matching the given pattern . This option can be specified more than once.", "signature": "-D pattern --exclude-database= pattern", "source_url": "/docs/14/app-pgamcheck.html", "description": "Exclude databases matching the given pattern . This option can be specified more than once."}, {"names": ["-i pattern", "--index= pattern"], "summary": "Check indexes matching the specified pattern , unless they are otherwise excluded. This option can be specified more than once.", "signature": "-i pattern --index= pattern", "source_url": "/docs/14/app-pgamcheck.html", "description": "Check indexes matching the specified pattern , unless they are otherwise excluded. This option can be specified more than once. This is similar to the --relation option, except that it applies only to indexes, not tables."}, {"names": ["-I pattern", "--exclude-index= pattern"], "summary": "Exclude indexes matching the specified pattern . This option can be specified more than once.", "signature": "-I pattern --exclude-index= pattern", "source_url": "/docs/14/app-pgamcheck.html", "description": "Exclude indexes matching the specified pattern . This option can be specified more than once. This is similar to the --exclude-relation option, except that it applies only to indexes, not tables."}, {"names": ["-r pattern", "--relation= pattern"], "summary": "Check relations matching the specified pattern , unless they are otherwise excluded. This option can be specified more than once.", "signature": "-r pattern --relation= pattern", "source_url": "/docs/14/app-pgamcheck.html", "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", "--exclude-relation= pattern"], "summary": "Exclude relations matching the specified pattern . This option can be specified more than once.", "signature": "-R pattern --exclude-relation= pattern", "source_url": "/docs/14/app-pgamcheck.html", "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": ["-s pattern", "--schema= pattern"], "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": "-s pattern --schema= pattern", "source_url": "/docs/14/app-pgamcheck.html", "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", "--exclude-schema= pattern"], "summary": "Exclude tables and indexes in schemas matching the specified pattern . This option can be specified more than once.", "signature": "-S pattern --exclude-schema= pattern", "source_url": "/docs/14/app-pgamcheck.html", "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": ["-t pattern", "--table= pattern"], "summary": "Check tables matching the specified pattern , unless they are otherwise excluded. This option can be specified more than once.", "signature": "-t pattern --table= pattern", "source_url": "/docs/14/app-pgamcheck.html", "description": "Check tables matching the specified pattern , unless they are otherwise excluded. This option can be specified more than once. This is similar to the --relation option, except that it applies only to tables, not indexes."}, {"names": ["-T pattern", "--exclude-table= pattern"], "summary": "Exclude tables matching the specified pattern . This option can be specified more than once.", "signature": "-T pattern --exclude-table= pattern", "source_url": "/docs/14/app-pgamcheck.html", "description": "Exclude tables matching the specified pattern . This option can be specified more than once. This is similar to the --exclude-relation option, except that it applies only to tables, not indexes."}, {"names": ["--no-dependent-indexes"], "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": "--no-dependent-indexes", "source_url": "/docs/14/app-pgamcheck.html", "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-toast"], "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": "--no-dependent-toast", "source_url": "/docs/14/app-pgamcheck.html", "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-strict-names"], "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": "--no-strict-names", "source_url": "/docs/14/app-pgamcheck.html", "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": ["--exclude-toast-pointers"], "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": "--exclude-toast-pointers", "source_url": "/docs/14/app-pgamcheck.html", "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": ["--on-error-stop"], "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": "--on-error-stop", "source_url": "/docs/14/app-pgamcheck.html", "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": ["--skip= option"], "summary": "If all-frozen is given, table corruption checks will skip over pages in all tables that are marked as all frozen.", "signature": "--skip= option", "source_url": "/docs/14/app-pgamcheck.html", "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": ["--startblock= block"], "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": "--startblock= block", "source_url": "/docs/14/app-pgamcheck.html", "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": ["--endblock= block"], "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": "--endblock= block", "source_url": "/docs/14/app-pgamcheck.html", "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": ["--heapallindexed"], "summary": "For each index checked, verify the presence of all heap tuples as index tuples in the index using amcheck 's heapallindexed option.", "signature": "--heapallindexed", "source_url": "/docs/14/app-pgamcheck.html", "description": "For each index checked, verify the presence of all heap tuples as index tuples in the index using amcheck 's heapallindexed option."}, {"names": ["--parent-check"], "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": "--parent-check", "source_url": "/docs/14/app-pgamcheck.html", "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": ["--rootdescend"], "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": "--rootdescend", "source_url": "/docs/14/app-pgamcheck.html", "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": ["-h hostname", "--host= hostname"], "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": "-h hostname --host= hostname", "source_url": "/docs/14/app-pgamcheck.html", "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": ["-p port", "--port= port"], "summary": "Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections.", "signature": "-p port --port= port", "source_url": "/docs/14/app-pgamcheck.html", "description": "Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections."}, {"names": ["-U", "--username= username"], "summary": "User name to connect as.", "signature": "-U --username= username", "source_url": "/docs/14/app-pgamcheck.html", "description": "User name to connect as."}, {"names": ["-w", "--no-password"], "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": "-w --no-password", "source_url": "/docs/14/app-pgamcheck.html", "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", "--password"], "summary": "Force pg_amcheck to prompt for a password before connecting to a database.", "signature": "-W --password", "source_url": "/docs/14/app-pgamcheck.html", "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": ["--maintenance-db= dbname"], "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": "--maintenance-db= dbname", "source_url": "/docs/14/app-pgamcheck.html", "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": ["-e", "--echo"], "summary": "Echo to stdout all SQL sent to the server.", "signature": "-e --echo", "source_url": "/docs/14/app-pgamcheck.html", "description": "Echo to stdout all SQL sent to the server."}, {"names": ["-j num", "--jobs= num"], "summary": "Use num concurrent connections to the server, or one per object to be checked, whichever is less.", "signature": "-j num --jobs= num", "source_url": "/docs/14/app-pgamcheck.html", "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": ["-P", "--progress"], "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": "-P --progress", "source_url": "/docs/14/app-pgamcheck.html", "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": ["-v", "--verbose"], "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": "-v --verbose", "source_url": "/docs/14/app-pgamcheck.html", "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", "--version"], "summary": "Print the pg_amcheck version and exit.", "signature": "-V --version", "source_url": "/docs/14/app-pgamcheck.html", "description": "Print the pg_amcheck version and exit."}, {"names": ["--install-missing", "--install-missing= schema"], "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": "--install-missing --install-missing= schema", "source_url": "/docs/14/app-pgamcheck.html", "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": ["-?", "--help"], "summary": "Show help about pg_amcheck command line arguments, and exit.", "signature": "-? --help", "source_url": "/docs/14/app-pgamcheck.html", "description": "Show help about pg_amcheck command line arguments, and exit."}], "related": [], "release": {"ref": "https://ftp.postgresql.org/pub/source/v14.24/postgresql-14.24.tar.bz2", "label": "14.24", "major": "14", "channel": "stable", "manifest": {"pdf": {"A4": {"url": "/files/documentation/pdf/14/postgresql-14-A4.pdf", "bytes": 14354704, "pages": 2944, "sha256": "8bc6b9dd7b246888bb77f0a5e8c39a2eae52e9926569832669c7d1600becb27c", "built_at": "2026-09-26"}, "US": {"url": "/files/documentation/pdf/14/postgresql-14-US.pdf", "bytes": 14242178, "pages": 3102, "sha256": "b7ecb5a5f62d8b9f73a69e25a7d26ba285373bc53168a553bff7b77955506db4", "built_at": "2026-09-26"}}, "tree": "14", "index": "index.html", "major": "14", "pages": 1158, "release": "14.24", "source_url": "https://ftp.postgresql.org/pub/source/v14.24/postgresql-14.24.tar.bz2", "svg_assets": 3, "source_mode": "en HTML verified against the pinned official archive", "source_sha256": "a7fa7ed3d558172355f51406097a7bd4f6b473be80f311ef7cda96bf383d8897"}, "revision": "588700d46356d8837c77c7c0a4e71e645fe6535983b8f1830aa8f2e4e41c40ae", "evidence_kind": "English manual and source declarations", "source_sha256": "a7fa7ed3d558172355f51406097a7bd4f6b473be80f311ef7cda96bf383d8897"}, "sources": [{"url": "/docs/14/app-pgamcheck.html", "file": "app-pgamcheck.html", "label": "14.24 English manual \u00b7 app-pgamcheck.html", "anchor": "", "sha256": "0c62e3cd367862b7005551386ddfeabcd07a6e27092d2d92e7402edc1bfa31bf"}, {"url": "/docs/14/reference-client.html", "file": "reference-client.html", "label": "Client applications inventory", "anchor": "", "sha256": "5a13567a052954dfe494dfaab9f50919faa1ae56023930fdbb78d45e53feccde"}], "sections": [], "synopsis": ["pg_amcheck [ option ...] [ dbname ]"], "signature": "pg_amcheck [ option ...] [ dbname ]", "description": ["pg_amcheck \u2014 checks for corruption in one or more PostgreSQL databases"], "environment": [], "manual_html": "<div><div class=\"refentry\" id=\"APP-PGAMCHECK\">\n<div class=\"titlepage\"></div>\n<div class=\"refnamediv\">\n<h2><span class=\"refentrytitle\"><span class=\"application\">pg_amcheck</span></span></h2>\n<p>pg_amcheck \u2014 checks for corruption in one or more <span class=\"productname\">PostgreSQL</span> databases</p>\n</div>\n<div class=\"refsynopsisdiv\">\n<h2>Synopsis</h2>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.4.9.4.1\"><code class=\"command\">pg_amcheck</code> [<em class=\"replaceable\"><code>option</code></em>...] [<em class=\"replaceable\"><code>dbname</code></em>]</p>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.4.9.5\">\n<h2>Description</h2>\n<p><span class=\"application\">pg_amcheck</span> supports running <a class=\"xref\" href=\"/docs/14/amcheck.html\" title=\"F.2.\u00a0amcheck\">amcheck</a>'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.</p>\n<p>Only table relations and btree indexes are currently supported. Other relation types are silently skipped.</p>\n<p>If <code class=\"literal\">dbname</code> 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 <code class=\"option\">--all</code>, <code class=\"option\">--database</code> and <code class=\"option\">--exclude-database</code>. They also include <code class=\"option\">--relation</code>, <code class=\"option\">--exclude-relation</code>, <code class=\"option\">--table</code>, <code class=\"option\">--exclude-table</code>, <code class=\"option\">--index</code>, and <code class=\"option\">--exclude-index</code>, but only when such options are used with a three-part pattern (e.g. <code class=\"option\">mydb*.myschema*.myrel*</code>). Finally, they include <code class=\"option\">--schema</code> and <code class=\"option\">--exclude-schema</code> when such options are used with a two-part pattern (e.g. <code class=\"option\">mydb*.myschema*</code>).</p>\n<p><em class=\"replaceable\"><code>dbname</code></em> can also be a <a class=\"link\" href=\"/docs/14/libpq-connect.html#LIBPQ-CONNSTRING\" title=\"34.1.1.\u00a0Connection Strings\">connection string</a>.</p>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.4.9.6\">\n<h2>Options</h2>\n<p>The following command-line options control what is checked:</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-a</code><br></span><span class=\"term\"><code class=\"option\">--all</code></span></dt>\n<dd>\n<p>Check all databases, except for any excluded via <code class=\"option\">--exclude-database</code>.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-d <em class=\"replaceable\"><code>pattern</code></em></code><br></span><span class=\"term\"><code class=\"option\">--database=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p>Check databases matching the specified <a class=\"link\" href=\"/docs/14/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"><em class=\"replaceable\"><code>pattern</code></em></a>, except for any excluded by <code class=\"option\">--exclude-database</code>. This option can be specified more than once.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-D <em class=\"replaceable\"><code>pattern</code></em></code><br></span><span class=\"term\"><code class=\"option\">--exclude-database=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p>Exclude databases matching the given <a class=\"link\" href=\"/docs/14/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"><em class=\"replaceable\"><code>pattern</code></em></a>. This option can be specified more than once.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-i <em class=\"replaceable\"><code>pattern</code></em></code><br></span><span class=\"term\"><code class=\"option\">--index=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p>Check indexes matching the specified <a class=\"link\" href=\"/docs/14/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"><em class=\"replaceable\"><code>pattern</code></em></a>, unless they are otherwise excluded. This option can be specified more than once.</p>\n<p>This is similar to the <code class=\"option\">--relation</code> option, except that it applies only to indexes, not tables.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-I <em class=\"replaceable\"><code>pattern</code></em></code><br></span><span class=\"term\"><code class=\"option\">--exclude-index=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p>Exclude indexes matching the specified <a class=\"link\" href=\"/docs/14/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"><em class=\"replaceable\"><code>pattern</code></em></a>. This option can be specified more than once.</p>\n<p>This is similar to the <code class=\"option\">--exclude-relation</code> option, except that it applies only to indexes, not tables.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-r <em class=\"replaceable\"><code>pattern</code></em></code><br></span><span class=\"term\"><code class=\"option\">--relation=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p>Check relations matching the specified <a class=\"link\" href=\"/docs/14/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"><em class=\"replaceable\"><code>pattern</code></em></a>, unless they are otherwise excluded. This option can be specified more than once.</p>\n<p>Patterns may be unqualified, e.g. <code class=\"literal\">myrel*</code>, or they may be schema-qualified, e.g. <code class=\"literal\">myschema*.myrel*</code> or database-qualified and schema-qualified, e.g. <code class=\"literal\">mydb*.myschema*.myrel*</code>. A database-qualified pattern will add matching databases to the list of databases to be checked.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-R <em class=\"replaceable\"><code>pattern</code></em></code><br></span><span class=\"term\"><code class=\"option\">--exclude-relation=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p>Exclude relations matching the specified <a class=\"link\" href=\"/docs/14/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"><em class=\"replaceable\"><code>pattern</code></em></a>. This option can be specified more than once.</p>\n<p>As with <code class=\"option\">--relation</code>, the <a class=\"link\" href=\"/docs/14/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"><em class=\"replaceable\"><code>pattern</code></em></a> may be unqualified, schema-qualified, or database- and schema-qualified.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-s <em class=\"replaceable\"><code>pattern</code></em></code><br></span><span class=\"term\"><code class=\"option\">--schema=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p>Check tables and indexes in schemas matching the specified <a class=\"link\" href=\"/docs/14/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"><em class=\"replaceable\"><code>pattern</code></em></a>, unless they are otherwise excluded. This option can be specified more than once.</p>\n<p>To select only tables in schemas matching a particular pattern, consider using something like <code class=\"literal\">--table=SCHEMAPAT.* --no-dependent-indexes</code>. To select only indexes, consider using something like <code class=\"literal\">--index=SCHEMAPAT.*</code>.</p>\n<p>A schema pattern may be database-qualified. For example, you may write <code class=\"literal\">--schema=mydb*.myschema*</code> to select schemas matching <code class=\"literal\">myschema*</code> in databases matching <code class=\"literal\">mydb*</code>.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-S <em class=\"replaceable\"><code>pattern</code></em></code><br></span><span class=\"term\"><code class=\"option\">--exclude-schema=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p>Exclude tables and indexes in schemas matching the specified <a class=\"link\" href=\"/docs/14/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"><em class=\"replaceable\"><code>pattern</code></em></a>. This option can be specified more than once.</p>\n<p>As with <code class=\"option\">--schema</code>, the pattern may be database-qualified.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-t <em class=\"replaceable\"><code>pattern</code></em></code><br></span><span class=\"term\"><code class=\"option\">--table=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p>Check tables matching the specified <a class=\"link\" href=\"/docs/14/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"><em class=\"replaceable\"><code>pattern</code></em></a>, unless they are otherwise excluded. This option can be specified more than once.</p>\n<p>This is similar to the <code class=\"option\">--relation</code> option, except that it applies only to tables, not indexes.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-T <em class=\"replaceable\"><code>pattern</code></em></code><br></span><span class=\"term\"><code class=\"option\">--exclude-table=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p>Exclude tables matching the specified <a class=\"link\" href=\"/docs/14/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"><em class=\"replaceable\"><code>pattern</code></em></a>. This option can be specified more than once.</p>\n<p>This is similar to the <code class=\"option\">--exclude-relation</code> option, except that it applies only to tables, not indexes.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-dependent-indexes</code></span></dt>\n<dd>\n<p>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 <code class=\"literal\">--index</code> or <code class=\"literal\">--relation</code>. This option suppresses that behavior.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-dependent-toast</code></span></dt>\n<dd>\n<p>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 <code class=\"literal\">--table</code> or <code class=\"literal\">--relation</code>. This option suppresses that behavior.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-strict-names</code></span></dt>\n<dd>\n<p>By default, if an argument to <code class=\"literal\">--database</code>, <code class=\"literal\">--table</code>, <code class=\"literal\">--index</code>, or <code class=\"literal\">--relation</code> matches no objects, it is a fatal error. This option downgrades that error to a warning.</p>\n</dd>\n</dl>\n</div>\n<p>The following command-line options control checking of tables:</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">--exclude-toast-pointers</code></span></dt>\n<dd>\n<p>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.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--on-error-stop</code></span></dt>\n<dd>\n<p>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.</p>\n<p>Note that index checking always stops after the first corrupt page. This option only has meaning relative to table relations.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--skip=<em class=\"replaceable\"><code>option</code></em></code></span></dt>\n<dd>\n<p>If <code class=\"literal\">all-frozen</code> is given, table corruption checks will skip over pages in all tables that are marked as all frozen.</p>\n<p>If <code class=\"literal\">all-visible</code> is given, table corruption checks will skip over pages in all tables that are marked as all visible.</p>\n<p>By default, no pages are skipped. This can be specified as <code class=\"literal\">none</code>, but since this is the default, it need not be mentioned.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--startblock=<em class=\"replaceable\"><code>block</code></em></code></span></dt>\n<dd>\n<p>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 <code class=\"literal\">--endblock</code> for further caveats.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--endblock=<em class=\"replaceable\"><code>block</code></em></code></span></dt>\n<dd>\n<p>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 <code class=\"option\">--exclude-toast-pointers</code>.</p>\n</dd>\n</dl>\n</div>\n<p>The following command-line options control checking of B-tree indexes:</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">--heapallindexed</code></span></dt>\n<dd>\n<p>For each index checked, verify the presence of all heap tuples as index tuples in the index using <a class=\"xref\" href=\"/docs/14/amcheck.html\" title=\"F.2.\u00a0amcheck\">amcheck</a>'s <code class=\"option\">heapallindexed</code> option.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--parent-check</code></span></dt>\n<dd>\n<p>For each btree index checked, use <a class=\"xref\" href=\"/docs/14/amcheck.html\" title=\"F.2.\u00a0amcheck\">amcheck</a>'s <code class=\"function\">bt_index_parent_check</code> function, which performs additional checks of parent/child relationships during index checking.</p>\n<p>The default is to use <span class=\"application\">amcheck</span>'s <code class=\"function\">bt_index_check</code> function, but note that use of the <code class=\"option\">--rootdescend</code> option implicitly selects <code class=\"function\">bt_index_parent_check</code>.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--rootdescend</code></span></dt>\n<dd>\n<p>For each index checked, re-find tuples on the leaf level by performing a new search from the root page for each tuple using <a class=\"xref\" href=\"/docs/14/amcheck.html\" title=\"F.2.\u00a0amcheck\">amcheck</a>'s <code class=\"option\">rootdescend</code> option.</p>\n<p>Use of this option implicitly also selects the <code class=\"option\">--parent-check</code> option.</p>\n<p>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.</p>\n</dd>\n</dl>\n</div>\n<div class=\"warning\">\n<h3 class=\"title\">Warning</h3>\n<p>The extra checks performed against B-tree indexes when the <code class=\"option\">--parent-check</code> option or the <code class=\"option\">--rootdescend</code> option is specified require relatively strong relation-level locks. These checks are the only checks that will block concurrent data modification from <code class=\"command\">INSERT</code>, <code class=\"command\">UPDATE</code>, and <code class=\"command\">DELETE</code> commands.</p>\n</div>\n<p>The following command-line options control the connection to the server:</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-h <em class=\"replaceable\"><code>hostname</code></em></code><br></span><span class=\"term\"><code class=\"option\">--host=<em class=\"replaceable\"><code>hostname</code></em></code></span></dt>\n<dd>\n<p>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.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-p <em class=\"replaceable\"><code>port</code></em></code><br></span><span class=\"term\"><code class=\"option\">--port=<em class=\"replaceable\"><code>port</code></em></code></span></dt>\n<dd>\n<p>Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-U</code><br></span><span class=\"term\"><code class=\"option\">--username=<em class=\"replaceable\"><code>username</code></em></code></span></dt>\n<dd>\n<p>User name to connect as.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-w</code><br></span><span class=\"term\"><code class=\"option\">--no-password</code></span></dt>\n<dd>\n<p>Never issue a password prompt. If the server requires password authentication and a password is not available by other means such as a <code class=\"filename\">.pgpass</code> 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.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-W</code><br></span><span class=\"term\"><code class=\"option\">--password</code></span></dt>\n<dd>\n<p>Force <span class=\"application\">pg_amcheck</span> to prompt for a password before connecting to a database.</p>\n<p>This option is never essential, since <span class=\"application\">pg_amcheck</span> will automatically prompt for a password if the server demands password authentication. However, <span class=\"application\">pg_amcheck</span> will waste a connection attempt finding out that the server wants a password. In some cases it is worth typing <code class=\"option\">-W</code> to avoid the extra connection attempt.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--maintenance-db=<em class=\"replaceable\"><code>dbname</code></em></code></span></dt>\n<dd>\n<p>Specifies a database or <a class=\"link\" href=\"/docs/14/libpq-connect.html#LIBPQ-CONNSTRING\" title=\"34.1.1.\u00a0Connection Strings\">connection string</a> to be used to discover the list of databases to be checked. If neither <code class=\"option\">--all</code> 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 <code class=\"literal\">postgres</code> or, if that fails, <code class=\"literal\">template1</code>.</p>\n</dd>\n</dl>\n</div>\n<p>Other options are also available:</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-e</code><br></span><span class=\"term\"><code class=\"option\">--echo</code></span></dt>\n<dd>\n<p>Echo to stdout all SQL sent to the server.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-j <em class=\"replaceable\"><code>num</code></em></code><br></span><span class=\"term\"><code class=\"option\">--jobs=<em class=\"replaceable\"><code>num</code></em></code></span></dt>\n<dd>\n<p>Use <em class=\"replaceable\"><code>num</code></em> concurrent connections to the server, or one per object to be checked, whichever is less.</p>\n<p>The default is to use a single connection.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-P</code><br></span><span class=\"term\"><code class=\"option\">--progress</code></span></dt>\n<dd>\n<p>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.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-v</code><br></span><span class=\"term\"><code class=\"option\">--verbose</code></span></dt>\n<dd>\n<p>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.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-V</code><br></span><span class=\"term\"><code class=\"option\">--version</code></span></dt>\n<dd>\n<p>Print the <span class=\"application\">pg_amcheck</span> version and exit.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--install-missing</code><br></span><span class=\"term\"><code class=\"option\">--install-missing=<em class=\"replaceable\"><code>schema</code></em></code></span></dt>\n<dd>\n<p>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 <em class=\"replaceable\"><code>schema</code></em>, or if not specified into schema <code class=\"literal\">pg_catalog</code>.</p>\n<p>At present, the only required extension is <a class=\"xref\" href=\"/docs/14/amcheck.html\" title=\"F.2.\u00a0amcheck\">amcheck</a>.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-?</code><br></span><span class=\"term\"><code class=\"option\">--help</code></span></dt>\n<dd>\n<p>Show help about <span class=\"application\">pg_amcheck</span> command line arguments, and exit.</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.4.9.7\">\n<h2>Notes</h2>\n<p><span class=\"application\">pg_amcheck</span> is designed to work with <span class=\"productname\">PostgreSQL</span> 14.0 and later.</p>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.4.9.8\">\n<h2>See Also</h2><span class=\"simplelist\"><a class=\"xref\" href=\"/docs/14/amcheck.html\" title=\"F.2.\u00a0amcheck\">amcheck</a></span>\n</div>\n</div></div>", "manual_path": "app-pgamcheck.html", "comparison_data": {"options": [{"names": ["-a", "--all"], "signature": "-a --all", "description": "Check all databases, except for any excluded via --exclude-database ."}, {"names": ["-d pattern", "--database= pattern"], "signature": "-d pattern --database= pattern", "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", "--exclude-database= pattern"], "signature": "-D pattern --exclude-database= pattern", "description": "Exclude databases matching the given pattern . This option can be specified more than once."}, {"names": ["-i pattern", "--index= pattern"], "signature": "-i pattern --index= pattern", "description": "Check indexes matching the specified pattern , unless they are otherwise excluded. This option can be specified more than once. This is similar to the --relation option, except that it applies only to indexes, not tables."}, {"names": ["-I pattern", "--exclude-index= pattern"], "signature": "-I pattern --exclude-index= pattern", "description": "Exclude indexes matching the specified pattern . This option can be specified more than once. This is similar to the --exclude-relation option, except that it applies only to indexes, not tables."}, {"names": ["-r pattern", "--relation= pattern"], "signature": "-r pattern --relation= 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", "--exclude-relation= pattern"], "signature": "-R pattern --exclude-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": ["-s pattern", "--schema= pattern"], "signature": "-s pattern --schema= 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", "--exclude-schema= pattern"], "signature": "-S pattern --exclude-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": ["-t pattern", "--table= pattern"], "signature": "-t pattern --table= pattern", "description": "Check tables matching the specified pattern , unless they are otherwise excluded. This option can be specified more than once. This is similar to the --relation option, except that it applies only to tables, not indexes."}, {"names": ["-T pattern", "--exclude-table= pattern"], "signature": "-T pattern --exclude-table= pattern", "description": "Exclude tables matching the specified pattern . This option can be specified more than once. This is similar to the --exclude-relation option, except that it applies only to tables, not indexes."}, {"names": ["--no-dependent-indexes"], "signature": "--no-dependent-indexes", "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-toast"], "signature": "--no-dependent-toast", "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-strict-names"], "signature": "--no-strict-names", "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": ["--exclude-toast-pointers"], "signature": "--exclude-toast-pointers", "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": ["--on-error-stop"], "signature": "--on-error-stop", "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": ["--skip= option"], "signature": "--skip= option", "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": ["--startblock= block"], "signature": "--startblock= block", "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": ["--endblock= block"], "signature": "--endblock= 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": ["--heapallindexed"], "signature": "--heapallindexed", "description": "For each index checked, verify the presence of all heap tuples as index tuples in the index using amcheck 's heapallindexed option."}, {"names": ["--parent-check"], "signature": "--parent-check", "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": ["--rootdescend"], "signature": "--rootdescend", "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": ["-h hostname", "--host= hostname"], "signature": "-h hostname --host= hostname", "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": ["-p port", "--port= port"], "signature": "-p port --port= port", "description": "Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections."}, {"names": ["-U", "--username= username"], "signature": "-U --username= username", "description": "User name to connect as."}, {"names": ["-w", "--no-password"], "signature": "-w --no-password", "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", "--password"], "signature": "-W --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": ["--maintenance-db= dbname"], "signature": "--maintenance-db= dbname", "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": ["-e", "--echo"], "signature": "-e --echo", "description": "Echo to stdout all SQL sent to the server."}, {"names": ["-j num", "--jobs= num"], "signature": "-j num --jobs= num", "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": ["-P", "--progress"], "signature": "-P --progress", "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": ["-v", "--verbose"], "signature": "-v --verbose", "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", "--version"], "signature": "-V --version", "description": "Print the pg_amcheck version and exit."}, {"names": ["--install-missing", "--install-missing= schema"], "signature": "--install-missing --install-missing= schema", "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": ["-?", "--help"], "signature": "-? --help", "description": "Show help about pg_amcheck command line arguments, and exit."}], "synopsis": ["pg_amcheck [ option ...] [ dbname ]"], "environment": []}, "comparison_hash": "361374d164971080489f57b64bd6a6e884d811351757814d8d269638d1e5222b"}, "15": {"facts": [{"label": "Documented executable", "value": "pg_amcheck"}, {"label": "Executable version", "value": "15.19"}, {"label": "Reference inventory", "value": "Client applications"}, {"label": "Option definition groups", "value": "35"}], "tables": [{"key": "options", "rows": [{"summary": "Check all databases, except for any excluded via --exclude-database .", "signature": {"url": "/docs/15/app-pgamcheck.html", "text": "-a --all"}}, {"summary": "Check databases matching the specified pattern , except for any excluded by --exclude-database . This option can be specified more than once.", "signature": {"url": "/docs/15/app-pgamcheck.html", "text": "-d pattern --database= pattern"}}, {"summary": "Exclude databases matching the given pattern . This option can be specified more than once.", "signature": {"url": "/docs/15/app-pgamcheck.html", "text": "-D pattern --exclude-database= pattern"}}, {"summary": "Check indexes matching the specified pattern , unless they are otherwise excluded. This option can be specified more than once.", "signature": {"url": "/docs/15/app-pgamcheck.html", "text": "-i pattern --index= pattern"}}, {"summary": "Exclude indexes matching the specified pattern . This option can be specified more than once.", "signature": {"url": "/docs/15/app-pgamcheck.html", "text": "-I pattern --exclude-index= pattern"}}, {"summary": "Check relations matching the specified pattern , unless they are otherwise excluded. This option can be specified more than once.", "signature": {"url": "/docs/15/app-pgamcheck.html", "text": "-r pattern --relation= pattern"}}, {"summary": "Exclude relations matching the specified pattern . This option can be specified more than once.", "signature": {"url": "/docs/15/app-pgamcheck.html", "text": "-R pattern --exclude-relation= pattern"}}, {"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": {"url": "/docs/15/app-pgamcheck.html", "text": "-s pattern --schema= pattern"}}, {"summary": "Exclude tables and indexes in schemas matching the specified pattern . This option can be specified more than once.", "signature": {"url": "/docs/15/app-pgamcheck.html", "text": "-S pattern --exclude-schema= pattern"}}, {"summary": "Check tables matching the specified pattern , unless they are otherwise excluded. This option can be specified more than once.", "signature": {"url": "/docs/15/app-pgamcheck.html", "text": "-t pattern --table= pattern"}}, {"summary": "Exclude tables matching the specified pattern . This option can be specified more than once.", "signature": {"url": "/docs/15/app-pgamcheck.html", "text": "-T pattern --exclude-table= pattern"}}, {"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": {"url": "/docs/15/app-pgamcheck.html", "text": "--no-dependent-indexes"}}, {"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": {"url": "/docs/15/app-pgamcheck.html", "text": "--no-dependent-toast"}}, {"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": {"url": "/docs/15/app-pgamcheck.html", "text": "--no-strict-names"}}, {"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": {"url": "/docs/15/app-pgamcheck.html", "text": "--exclude-toast-pointers"}}, {"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": {"url": "/docs/15/app-pgamcheck.html", "text": "--on-error-stop"}}, {"summary": "If all-frozen is given, table corruption checks will skip over pages in all tables that are marked as all frozen.", "signature": {"url": "/docs/15/app-pgamcheck.html", "text": "--skip= option"}}, {"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": {"url": "/docs/15/app-pgamcheck.html", "text": "--startblock= block"}}, {"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": {"url": "/docs/15/app-pgamcheck.html", "text": "--endblock= block"}}, {"summary": "For each index checked, verify the presence of all heap tuples as index tuples in the index using amcheck 's heapallindexed option.", "signature": {"url": "/docs/15/app-pgamcheck.html", "text": "--heapallindexed"}}, {"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": {"url": "/docs/15/app-pgamcheck.html", "text": "--parent-check"}}, {"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": {"url": "/docs/15/app-pgamcheck.html", "text": "--rootdescend"}}, {"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": {"url": "/docs/15/app-pgamcheck.html", "text": "-h hostname --host= hostname"}}, {"summary": "Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections.", "signature": {"url": "/docs/15/app-pgamcheck.html", "text": "-p port --port= port"}}, {"summary": "User name to connect as.", "signature": {"url": "/docs/15/app-pgamcheck.html", "text": "-U --username= username"}}, {"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": {"url": "/docs/15/app-pgamcheck.html", "text": "-w --no-password"}}, {"summary": "Force pg_amcheck to prompt for a password before connecting to a database.", "signature": {"url": "/docs/15/app-pgamcheck.html", "text": "-W --password"}}, {"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": {"url": "/docs/15/app-pgamcheck.html", "text": "--maintenance-db= dbname"}}, {"summary": "Echo to stdout all SQL sent to the server.", "signature": {"url": "/docs/15/app-pgamcheck.html", "text": "-e --echo"}}, {"summary": "Use num concurrent connections to the server, or one per object to be checked, whichever is less.", "signature": {"url": "/docs/15/app-pgamcheck.html", "text": "-j num --jobs= num"}}, {"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": {"url": "/docs/15/app-pgamcheck.html", "text": "-P --progress"}}, {"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": {"url": "/docs/15/app-pgamcheck.html", "text": "-v --verbose"}}, {"summary": "Print the pg_amcheck version and exit.", "signature": {"url": "/docs/15/app-pgamcheck.html", "text": "-V --version"}}, {"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": {"url": "/docs/15/app-pgamcheck.html", "text": "--install-missing --install-missing= schema"}}, {"summary": "Show help about pg_amcheck command line arguments, and exit.", "signature": {"url": "/docs/15/app-pgamcheck.html", "text": "-? --help"}}], "title": "Documented options", "columns": [{"key": "signature", "label": "Option and arguments"}, {"key": "summary", "label": "Description"}]}], "options": [{"names": ["-a", "--all"], "summary": "Check all databases, except for any excluded via --exclude-database .", "signature": "-a --all", "source_url": "/docs/15/app-pgamcheck.html", "description": "Check all databases, except for any excluded via --exclude-database ."}, {"names": ["-d pattern", "--database= pattern"], "summary": "Check databases matching the specified pattern , except for any excluded by --exclude-database . This option can be specified more than once.", "signature": "-d pattern --database= pattern", "source_url": "/docs/15/app-pgamcheck.html", "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", "--exclude-database= pattern"], "summary": "Exclude databases matching the given pattern . This option can be specified more than once.", "signature": "-D pattern --exclude-database= pattern", "source_url": "/docs/15/app-pgamcheck.html", "description": "Exclude databases matching the given pattern . This option can be specified more than once."}, {"names": ["-i pattern", "--index= pattern"], "summary": "Check indexes matching the specified pattern , unless they are otherwise excluded. This option can be specified more than once.", "signature": "-i pattern --index= pattern", "source_url": "/docs/15/app-pgamcheck.html", "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", "--exclude-index= pattern"], "summary": "Exclude indexes matching the specified pattern . This option can be specified more than once.", "signature": "-I pattern --exclude-index= pattern", "source_url": "/docs/15/app-pgamcheck.html", "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": ["-r pattern", "--relation= pattern"], "summary": "Check relations matching the specified pattern , unless they are otherwise excluded. This option can be specified more than once.", "signature": "-r pattern --relation= pattern", "source_url": "/docs/15/app-pgamcheck.html", "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", "--exclude-relation= pattern"], "summary": "Exclude relations matching the specified pattern . This option can be specified more than once.", "signature": "-R pattern --exclude-relation= pattern", "source_url": "/docs/15/app-pgamcheck.html", "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": ["-s pattern", "--schema= pattern"], "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": "-s pattern --schema= pattern", "source_url": "/docs/15/app-pgamcheck.html", "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", "--exclude-schema= pattern"], "summary": "Exclude tables and indexes in schemas matching the specified pattern . This option can be specified more than once.", "signature": "-S pattern --exclude-schema= pattern", "source_url": "/docs/15/app-pgamcheck.html", "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": ["-t pattern", "--table= pattern"], "summary": "Check tables matching the specified pattern , unless they are otherwise excluded. This option can be specified more than once.", "signature": "-t pattern --table= pattern", "source_url": "/docs/15/app-pgamcheck.html", "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", "--exclude-table= pattern"], "summary": "Exclude tables matching the specified pattern . This option can be specified more than once.", "signature": "-T pattern --exclude-table= pattern", "source_url": "/docs/15/app-pgamcheck.html", "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": ["--no-dependent-indexes"], "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": "--no-dependent-indexes", "source_url": "/docs/15/app-pgamcheck.html", "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-toast"], "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": "--no-dependent-toast", "source_url": "/docs/15/app-pgamcheck.html", "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-strict-names"], "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": "--no-strict-names", "source_url": "/docs/15/app-pgamcheck.html", "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": ["--exclude-toast-pointers"], "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": "--exclude-toast-pointers", "source_url": "/docs/15/app-pgamcheck.html", "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": ["--on-error-stop"], "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": "--on-error-stop", "source_url": "/docs/15/app-pgamcheck.html", "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": ["--skip= option"], "summary": "If all-frozen is given, table corruption checks will skip over pages in all tables that are marked as all frozen.", "signature": "--skip= option", "source_url": "/docs/15/app-pgamcheck.html", "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": ["--startblock= block"], "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": "--startblock= block", "source_url": "/docs/15/app-pgamcheck.html", "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": ["--endblock= block"], "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": "--endblock= block", "source_url": "/docs/15/app-pgamcheck.html", "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": ["--heapallindexed"], "summary": "For each index checked, verify the presence of all heap tuples as index tuples in the index using amcheck 's heapallindexed option.", "signature": "--heapallindexed", "source_url": "/docs/15/app-pgamcheck.html", "description": "For each index checked, verify the presence of all heap tuples as index tuples in the index using amcheck 's heapallindexed option."}, {"names": ["--parent-check"], "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": "--parent-check", "source_url": "/docs/15/app-pgamcheck.html", "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": ["--rootdescend"], "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": "--rootdescend", "source_url": "/docs/15/app-pgamcheck.html", "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": ["-h hostname", "--host= hostname"], "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": "-h hostname --host= hostname", "source_url": "/docs/15/app-pgamcheck.html", "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": ["-p port", "--port= port"], "summary": "Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections.", "signature": "-p port --port= port", "source_url": "/docs/15/app-pgamcheck.html", "description": "Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections."}, {"names": ["-U", "--username= username"], "summary": "User name to connect as.", "signature": "-U --username= username", "source_url": "/docs/15/app-pgamcheck.html", "description": "User name to connect as."}, {"names": ["-w", "--no-password"], "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": "-w --no-password", "source_url": "/docs/15/app-pgamcheck.html", "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", "--password"], "summary": "Force pg_amcheck to prompt for a password before connecting to a database.", "signature": "-W --password", "source_url": "/docs/15/app-pgamcheck.html", "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": ["--maintenance-db= dbname"], "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": "--maintenance-db= dbname", "source_url": "/docs/15/app-pgamcheck.html", "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": ["-e", "--echo"], "summary": "Echo to stdout all SQL sent to the server.", "signature": "-e --echo", "source_url": "/docs/15/app-pgamcheck.html", "description": "Echo to stdout all SQL sent to the server."}, {"names": ["-j num", "--jobs= num"], "summary": "Use num concurrent connections to the server, or one per object to be checked, whichever is less.", "signature": "-j num --jobs= num", "source_url": "/docs/15/app-pgamcheck.html", "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": ["-P", "--progress"], "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": "-P --progress", "source_url": "/docs/15/app-pgamcheck.html", "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": ["-v", "--verbose"], "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": "-v --verbose", "source_url": "/docs/15/app-pgamcheck.html", "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", "--version"], "summary": "Print the pg_amcheck version and exit.", "signature": "-V --version", "source_url": "/docs/15/app-pgamcheck.html", "description": "Print the pg_amcheck version and exit."}, {"names": ["--install-missing", "--install-missing= schema"], "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": "--install-missing --install-missing= schema", "source_url": "/docs/15/app-pgamcheck.html", "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": ["-?", "--help"], "summary": "Show help about pg_amcheck command line arguments, and exit.", "signature": "-? --help", "source_url": "/docs/15/app-pgamcheck.html", "description": "Show help about pg_amcheck command line arguments, and exit."}], "related": [], "release": {"ref": "https://ftp.postgresql.org/pub/source/v15.19/postgresql-15.19.tar.bz2", "label": "15.19", "major": "15", "channel": "stable", "manifest": {"pdf": {"A4": {"url": "/files/documentation/pdf/15/postgresql-15-A4.pdf", "bytes": 14609140, "pages": 2987, "sha256": "66228564a4d16efb47d6a914085716ecfe22ca1566db56bc7c3d82f790646d72", "built_at": "2026-09-26"}, "US": {"url": "/files/documentation/pdf/15/postgresql-15-US.pdf", "bytes": 14495690, "pages": 3153, "sha256": "645a498c2390d47a6223ec74770631185807a19c484edb0fc5a295d9f460bc02", "built_at": "2026-09-26"}}, "tree": "15", "index": "index.html", "major": "15", "pages": 1168, "release": "15.19", "source_url": "https://ftp.postgresql.org/pub/source/v15.19/postgresql-15.19.tar.bz2", "svg_assets": 3, "source_mode": "en HTML verified against the pinned official archive", "source_sha256": "e1a64a87a46b825b88c082e4518161a47aab53c45694964f8ba1df28f7859f89"}, "revision": "6af958c6520151fc7697d56e0616b03fb00522c4568158674d452ae0644ba545", "evidence_kind": "English manual and source declarations", "source_sha256": "e1a64a87a46b825b88c082e4518161a47aab53c45694964f8ba1df28f7859f89"}, "sources": [{"url": "/docs/15/app-pgamcheck.html", "file": "app-pgamcheck.html", "label": "15.19 English manual \u00b7 app-pgamcheck.html", "anchor": "", "sha256": "e4088bca51857c5e042b980ed116ea580a26fa1ba687ddd817ad892333d199de"}, {"url": "/docs/15/reference-client.html", "file": "reference-client.html", "label": "Client applications inventory", "anchor": "", "sha256": "015b2ea2bd205946a55a1b837e735570631bac831c92074a6bf58444f9a3cb98"}], "sections": [], "synopsis": ["pg_amcheck [ option ...] [ dbname ]"], "signature": "pg_amcheck [ option ...] [ dbname ]", "description": ["pg_amcheck \u2014 checks for corruption in one or more PostgreSQL databases"], "environment": [], "manual_html": "<div><div class=\"refentry\" id=\"APP-PGAMCHECK\">\n<div class=\"titlepage\"></div>\n<div class=\"refnamediv\">\n<h2><span class=\"refentrytitle\"><span class=\"application\">pg_amcheck</span></span></h2>\n<p>pg_amcheck \u2014 checks for corruption in one or more <span class=\"productname\">PostgreSQL</span> databases</p>\n</div>\n<div class=\"refsynopsisdiv\">\n<h2>Synopsis</h2>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.4.9.4.1\"><code class=\"command\">pg_amcheck</code> [<em class=\"replaceable\"><code>option</code></em>...] [<em class=\"replaceable\"><code>dbname</code></em>]</p>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.4.9.5\">\n<h2>Description</h2>\n<p><span class=\"application\">pg_amcheck</span> supports running <a class=\"xref\" href=\"/docs/15/amcheck.html\" title=\"F.2.\u00a0amcheck\">amcheck</a>'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.</p>\n<p>Only ordinary and toast table relations, materialized views, sequences, and btree indexes are currently supported. Other relation types are silently skipped.</p>\n<p>If <code class=\"literal\">dbname</code> 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 <code class=\"option\">--all</code>, <code class=\"option\">--database</code> and <code class=\"option\">--exclude-database</code>. They also include <code class=\"option\">--relation</code>, <code class=\"option\">--exclude-relation</code>, <code class=\"option\">--table</code>, <code class=\"option\">--exclude-table</code>, <code class=\"option\">--index</code>, and <code class=\"option\">--exclude-index</code>, but only when such options are used with a three-part pattern (e.g. <code class=\"option\">mydb*.myschema*.myrel*</code>). Finally, they include <code class=\"option\">--schema</code> and <code class=\"option\">--exclude-schema</code> when such options are used with a two-part pattern (e.g. <code class=\"option\">mydb*.myschema*</code>).</p>\n<p><em class=\"replaceable\"><code>dbname</code></em> can also be a <a class=\"link\" href=\"/docs/15/libpq-connect.html#LIBPQ-CONNSTRING\" title=\"34.1.1.\u00a0Connection Strings\">connection string</a>.</p>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.4.9.6\">\n<h2>Options</h2>\n<p>The following command-line options control what is checked:</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-a</code><br></span><span class=\"term\"><code class=\"option\">--all</code></span></dt>\n<dd>\n<p>Check all databases, except for any excluded via <code class=\"option\">--exclude-database</code>.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-d <em class=\"replaceable\"><code>pattern</code></em></code><br></span><span class=\"term\"><code class=\"option\">--database=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p>Check databases matching the specified <a class=\"link\" href=\"/docs/15/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"><em class=\"replaceable\"><code>pattern</code></em></a>, except for any excluded by <code class=\"option\">--exclude-database</code>. This option can be specified more than once.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-D <em class=\"replaceable\"><code>pattern</code></em></code><br></span><span class=\"term\"><code class=\"option\">--exclude-database=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p>Exclude databases matching the given <a class=\"link\" href=\"/docs/15/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"><em class=\"replaceable\"><code>pattern</code></em></a>. This option can be specified more than once.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-i <em class=\"replaceable\"><code>pattern</code></em></code><br></span><span class=\"term\"><code class=\"option\">--index=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p>Check indexes matching the specified <a class=\"link\" href=\"/docs/15/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"><em class=\"replaceable\"><code>pattern</code></em></a>, unless they are otherwise excluded. This option can be specified more than once.</p>\n<p>This is similar to the <code class=\"option\">--relation</code> option, except that it applies only to indexes, not to other relation types.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-I <em class=\"replaceable\"><code>pattern</code></em></code><br></span><span class=\"term\"><code class=\"option\">--exclude-index=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p>Exclude indexes matching the specified <a class=\"link\" href=\"/docs/15/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"><em class=\"replaceable\"><code>pattern</code></em></a>. This option can be specified more than once.</p>\n<p>This is similar to the <code class=\"option\">--exclude-relation</code> option, except that it applies only to indexes, not other relation types.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-r <em class=\"replaceable\"><code>pattern</code></em></code><br></span><span class=\"term\"><code class=\"option\">--relation=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p>Check relations matching the specified <a class=\"link\" href=\"/docs/15/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"><em class=\"replaceable\"><code>pattern</code></em></a>, unless they are otherwise excluded. This option can be specified more than once.</p>\n<p>Patterns may be unqualified, e.g. <code class=\"literal\">myrel*</code>, or they may be schema-qualified, e.g. <code class=\"literal\">myschema*.myrel*</code> or database-qualified and schema-qualified, e.g. <code class=\"literal\">mydb*.myschema*.myrel*</code>. A database-qualified pattern will add matching databases to the list of databases to be checked.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-R <em class=\"replaceable\"><code>pattern</code></em></code><br></span><span class=\"term\"><code class=\"option\">--exclude-relation=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p>Exclude relations matching the specified <a class=\"link\" href=\"/docs/15/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"><em class=\"replaceable\"><code>pattern</code></em></a>. This option can be specified more than once.</p>\n<p>As with <code class=\"option\">--relation</code>, the <a class=\"link\" href=\"/docs/15/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"><em class=\"replaceable\"><code>pattern</code></em></a> may be unqualified, schema-qualified, or database- and schema-qualified.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-s <em class=\"replaceable\"><code>pattern</code></em></code><br></span><span class=\"term\"><code class=\"option\">--schema=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p>Check tables and indexes in schemas matching the specified <a class=\"link\" href=\"/docs/15/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"><em class=\"replaceable\"><code>pattern</code></em></a>, unless they are otherwise excluded. This option can be specified more than once.</p>\n<p>To select only tables in schemas matching a particular pattern, consider using something like <code class=\"literal\">--table=SCHEMAPAT.* --no-dependent-indexes</code>. To select only indexes, consider using something like <code class=\"literal\">--index=SCHEMAPAT.*</code>.</p>\n<p>A schema pattern may be database-qualified. For example, you may write <code class=\"literal\">--schema=mydb*.myschema*</code> to select schemas matching <code class=\"literal\">myschema*</code> in databases matching <code class=\"literal\">mydb*</code>.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-S <em class=\"replaceable\"><code>pattern</code></em></code><br></span><span class=\"term\"><code class=\"option\">--exclude-schema=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p>Exclude tables and indexes in schemas matching the specified <a class=\"link\" href=\"/docs/15/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"><em class=\"replaceable\"><code>pattern</code></em></a>. This option can be specified more than once.</p>\n<p>As with <code class=\"option\">--schema</code>, the pattern may be database-qualified.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-t <em class=\"replaceable\"><code>pattern</code></em></code><br></span><span class=\"term\"><code class=\"option\">--table=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p>Check tables matching the specified <a class=\"link\" href=\"/docs/15/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"><em class=\"replaceable\"><code>pattern</code></em></a>, unless they are otherwise excluded. This option can be specified more than once.</p>\n<p>This is similar to the <code class=\"option\">--relation</code> option, except that it applies only to tables, materialized views, and sequences, not to indexes.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-T <em class=\"replaceable\"><code>pattern</code></em></code><br></span><span class=\"term\"><code class=\"option\">--exclude-table=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p>Exclude tables matching the specified <a class=\"link\" href=\"/docs/15/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"><em class=\"replaceable\"><code>pattern</code></em></a>. This option can be specified more than once.</p>\n<p>This is similar to the <code class=\"option\">--exclude-relation</code> option, except that it applies only to tables, materialized views, and sequences, not to indexes.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-dependent-indexes</code></span></dt>\n<dd>\n<p>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 <code class=\"literal\">--index</code> or <code class=\"literal\">--relation</code>. This option suppresses that behavior.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-dependent-toast</code></span></dt>\n<dd>\n<p>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 <code class=\"literal\">--table</code> or <code class=\"literal\">--relation</code>. This option suppresses that behavior.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-strict-names</code></span></dt>\n<dd>\n<p>By default, if an argument to <code class=\"literal\">--database</code>, <code class=\"literal\">--table</code>, <code class=\"literal\">--index</code>, or <code class=\"literal\">--relation</code> matches no objects, it is a fatal error. This option downgrades that error to a warning.</p>\n</dd>\n</dl>\n</div>\n<p>The following command-line options control checking of tables:</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">--exclude-toast-pointers</code></span></dt>\n<dd>\n<p>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.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--on-error-stop</code></span></dt>\n<dd>\n<p>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.</p>\n<p>Note that index checking always stops after the first corrupt page. This option only has meaning relative to table relations.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--skip=<em class=\"replaceable\"><code>option</code></em></code></span></dt>\n<dd>\n<p>If <code class=\"literal\">all-frozen</code> is given, table corruption checks will skip over pages in all tables that are marked as all frozen.</p>\n<p>If <code class=\"literal\">all-visible</code> is given, table corruption checks will skip over pages in all tables that are marked as all visible.</p>\n<p>By default, no pages are skipped. This can be specified as <code class=\"literal\">none</code>, but since this is the default, it need not be mentioned.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--startblock=<em class=\"replaceable\"><code>block</code></em></code></span></dt>\n<dd>\n<p>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 <code class=\"literal\">--endblock</code> for further caveats.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--endblock=<em class=\"replaceable\"><code>block</code></em></code></span></dt>\n<dd>\n<p>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 <code class=\"option\">--exclude-toast-pointers</code>.</p>\n</dd>\n</dl>\n</div>\n<p>The following command-line options control checking of B-tree indexes:</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">--heapallindexed</code></span></dt>\n<dd>\n<p>For each index checked, verify the presence of all heap tuples as index tuples in the index using <a class=\"xref\" href=\"/docs/15/amcheck.html\" title=\"F.2.\u00a0amcheck\">amcheck</a>'s <code class=\"option\">heapallindexed</code> option.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--parent-check</code></span></dt>\n<dd>\n<p>For each btree index checked, use <a class=\"xref\" href=\"/docs/15/amcheck.html\" title=\"F.2.\u00a0amcheck\">amcheck</a>'s <code class=\"function\">bt_index_parent_check</code> function, which performs additional checks of parent/child relationships during index checking.</p>\n<p>The default is to use <span class=\"application\">amcheck</span>'s <code class=\"function\">bt_index_check</code> function, but note that use of the <code class=\"option\">--rootdescend</code> option implicitly selects <code class=\"function\">bt_index_parent_check</code>.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--rootdescend</code></span></dt>\n<dd>\n<p>For each index checked, re-find tuples on the leaf level by performing a new search from the root page for each tuple using <a class=\"xref\" href=\"/docs/15/amcheck.html\" title=\"F.2.\u00a0amcheck\">amcheck</a>'s <code class=\"option\">rootdescend</code> option.</p>\n<p>Use of this option implicitly also selects the <code class=\"option\">--parent-check</code> option.</p>\n<p>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.</p>\n</dd>\n</dl>\n</div>\n<div class=\"warning\">\n<h3 class=\"title\">Warning</h3>\n<p>The extra checks performed against B-tree indexes when the <code class=\"option\">--parent-check</code> option or the <code class=\"option\">--rootdescend</code> option is specified require relatively strong relation-level locks. These checks are the only checks that will block concurrent data modification from <code class=\"command\">INSERT</code>, <code class=\"command\">UPDATE</code>, and <code class=\"command\">DELETE</code> commands.</p>\n</div>\n<p>The following command-line options control the connection to the server:</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-h <em class=\"replaceable\"><code>hostname</code></em></code><br></span><span class=\"term\"><code class=\"option\">--host=<em class=\"replaceable\"><code>hostname</code></em></code></span></dt>\n<dd>\n<p>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.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-p <em class=\"replaceable\"><code>port</code></em></code><br></span><span class=\"term\"><code class=\"option\">--port=<em class=\"replaceable\"><code>port</code></em></code></span></dt>\n<dd>\n<p>Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-U</code><br></span><span class=\"term\"><code class=\"option\">--username=<em class=\"replaceable\"><code>username</code></em></code></span></dt>\n<dd>\n<p>User name to connect as.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-w</code><br></span><span class=\"term\"><code class=\"option\">--no-password</code></span></dt>\n<dd>\n<p>Never issue a password prompt. If the server requires password authentication and a password is not available by other means such as a <code class=\"filename\">.pgpass</code> 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.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-W</code><br></span><span class=\"term\"><code class=\"option\">--password</code></span></dt>\n<dd>\n<p>Force <span class=\"application\">pg_amcheck</span> to prompt for a password before connecting to a database.</p>\n<p>This option is never essential, since <span class=\"application\">pg_amcheck</span> will automatically prompt for a password if the server demands password authentication. However, <span class=\"application\">pg_amcheck</span> will waste a connection attempt finding out that the server wants a password. In some cases it is worth typing <code class=\"option\">-W</code> to avoid the extra connection attempt.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--maintenance-db=<em class=\"replaceable\"><code>dbname</code></em></code></span></dt>\n<dd>\n<p>Specifies a database or <a class=\"link\" href=\"/docs/15/libpq-connect.html#LIBPQ-CONNSTRING\" title=\"34.1.1.\u00a0Connection Strings\">connection string</a> to be used to discover the list of databases to be checked. If neither <code class=\"option\">--all</code> 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 <code class=\"literal\">postgres</code> or, if that fails, <code class=\"literal\">template1</code>.</p>\n</dd>\n</dl>\n</div>\n<p>Other options are also available:</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-e</code><br></span><span class=\"term\"><code class=\"option\">--echo</code></span></dt>\n<dd>\n<p>Echo to stdout all SQL sent to the server.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-j <em class=\"replaceable\"><code>num</code></em></code><br></span><span class=\"term\"><code class=\"option\">--jobs=<em class=\"replaceable\"><code>num</code></em></code></span></dt>\n<dd>\n<p>Use <em class=\"replaceable\"><code>num</code></em> concurrent connections to the server, or one per object to be checked, whichever is less.</p>\n<p>The default is to use a single connection.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-P</code><br></span><span class=\"term\"><code class=\"option\">--progress</code></span></dt>\n<dd>\n<p>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.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-v</code><br></span><span class=\"term\"><code class=\"option\">--verbose</code></span></dt>\n<dd>\n<p>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.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-V</code><br></span><span class=\"term\"><code class=\"option\">--version</code></span></dt>\n<dd>\n<p>Print the <span class=\"application\">pg_amcheck</span> version and exit.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--install-missing</code><br></span><span class=\"term\"><code class=\"option\">--install-missing=<em class=\"replaceable\"><code>schema</code></em></code></span></dt>\n<dd>\n<p>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 <em class=\"replaceable\"><code>schema</code></em>, or if not specified into schema <code class=\"literal\">pg_catalog</code>.</p>\n<p>At present, the only required extension is <a class=\"xref\" href=\"/docs/15/amcheck.html\" title=\"F.2.\u00a0amcheck\">amcheck</a>.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-?</code><br></span><span class=\"term\"><code class=\"option\">--help</code></span></dt>\n<dd>\n<p>Show help about <span class=\"application\">pg_amcheck</span> command line arguments, and exit.</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.4.9.7\">\n<h2>Notes</h2>\n<p><span class=\"application\">pg_amcheck</span> is designed to work with <span class=\"productname\">PostgreSQL</span> 14.0 and later.</p>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.4.9.8\">\n<h2>See Also</h2><span class=\"simplelist\"><a class=\"xref\" href=\"/docs/15/amcheck.html\" title=\"F.2.\u00a0amcheck\">amcheck</a></span>\n</div>\n</div></div>", "manual_path": "app-pgamcheck.html", "comparison_data": {"options": [{"names": ["-a", "--all"], "signature": "-a --all", "description": "Check all databases, except for any excluded via --exclude-database ."}, {"names": ["-d pattern", "--database= pattern"], "signature": "-d pattern --database= pattern", "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", "--exclude-database= pattern"], "signature": "-D pattern --exclude-database= pattern", "description": "Exclude databases matching the given pattern . This option can be specified more than once."}, {"names": ["-i pattern", "--index= pattern"], "signature": "-i pattern --index= 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", "--exclude-index= pattern"], "signature": "-I pattern --exclude-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": ["-r pattern", "--relation= pattern"], "signature": "-r pattern --relation= 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", "--exclude-relation= pattern"], "signature": "-R pattern --exclude-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": ["-s pattern", "--schema= pattern"], "signature": "-s pattern --schema= 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", "--exclude-schema= pattern"], "signature": "-S pattern --exclude-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": ["-t pattern", "--table= pattern"], "signature": "-t pattern --table= 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", "--exclude-table= pattern"], "signature": "-T pattern --exclude-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": ["--no-dependent-indexes"], "signature": "--no-dependent-indexes", "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-toast"], "signature": "--no-dependent-toast", "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-strict-names"], "signature": "--no-strict-names", "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": ["--exclude-toast-pointers"], "signature": "--exclude-toast-pointers", "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": ["--on-error-stop"], "signature": "--on-error-stop", "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": ["--skip= option"], "signature": "--skip= option", "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": ["--startblock= block"], "signature": "--startblock= block", "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": ["--endblock= block"], "signature": "--endblock= 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": ["--heapallindexed"], "signature": "--heapallindexed", "description": "For each index checked, verify the presence of all heap tuples as index tuples in the index using amcheck 's heapallindexed option."}, {"names": ["--parent-check"], "signature": "--parent-check", "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": ["--rootdescend"], "signature": "--rootdescend", "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": ["-h hostname", "--host= hostname"], "signature": "-h hostname --host= hostname", "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": ["-p port", "--port= port"], "signature": "-p port --port= port", "description": "Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections."}, {"names": ["-U", "--username= username"], "signature": "-U --username= username", "description": "User name to connect as."}, {"names": ["-w", "--no-password"], "signature": "-w --no-password", "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", "--password"], "signature": "-W --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": ["--maintenance-db= dbname"], "signature": "--maintenance-db= dbname", "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": ["-e", "--echo"], "signature": "-e --echo", "description": "Echo to stdout all SQL sent to the server."}, {"names": ["-j num", "--jobs= num"], "signature": "-j num --jobs= num", "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": ["-P", "--progress"], "signature": "-P --progress", "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": ["-v", "--verbose"], "signature": "-v --verbose", "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", "--version"], "signature": "-V --version", "description": "Print the pg_amcheck version and exit."}, {"names": ["--install-missing", "--install-missing= schema"], "signature": "--install-missing --install-missing= schema", "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": ["-?", "--help"], "signature": "-? --help", "description": "Show help about pg_amcheck command line arguments, and exit."}], "synopsis": ["pg_amcheck [ option ...] [ dbname ]"], "environment": []}, "comparison_hash": "27fb7b188a266efb8574a81e72c1b428521ad8791ecacdbdd7d7221e5e1cf058"}, "16": {"facts": [{"label": "Documented executable", "value": "pg_amcheck"}, {"label": "Executable version", "value": "16.15"}, {"label": "Reference inventory", "value": "Client applications"}, {"label": "Option definition groups", "value": "35"}], "tables": [{"key": "options", "rows": [{"summary": "Check all databases, except for any excluded via --exclude-database .", "signature": {"url": "/docs/16/app-pgamcheck.html", "text": "-a --all"}}, {"summary": "Check databases matching the specified pattern , except for any excluded by --exclude-database . This option can be specified more than once.", "signature": {"url": "/docs/16/app-pgamcheck.html", "text": "-d pattern --database= pattern"}}, {"summary": "Exclude databases matching the given pattern . This option can be specified more than once.", "signature": {"url": "/docs/16/app-pgamcheck.html", "text": "-D pattern --exclude-database= pattern"}}, {"summary": "Check indexes matching the specified pattern , unless they are otherwise excluded. This option can be specified more than once.", "signature": {"url": "/docs/16/app-pgamcheck.html", "text": "-i pattern --index= pattern"}}, {"summary": "Exclude indexes matching the specified pattern . This option can be specified more than once.", "signature": {"url": "/docs/16/app-pgamcheck.html", "text": "-I pattern --exclude-index= pattern"}}, {"summary": "Check relations matching the specified pattern , unless they are otherwise excluded. This option can be specified more than once.", "signature": {"url": "/docs/16/app-pgamcheck.html", "text": "-r pattern --relation= pattern"}}, {"summary": "Exclude relations matching the specified pattern . This option can be specified more than once.", "signature": {"url": "/docs/16/app-pgamcheck.html", "text": "-R pattern --exclude-relation= pattern"}}, {"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": {"url": "/docs/16/app-pgamcheck.html", "text": "-s pattern --schema= pattern"}}, {"summary": "Exclude tables and indexes in schemas matching the specified pattern . This option can be specified more than once.", "signature": {"url": "/docs/16/app-pgamcheck.html", "text": "-S pattern --exclude-schema= pattern"}}, {"summary": "Check tables matching the specified pattern , unless they are otherwise excluded. This option can be specified more than once.", "signature": {"url": "/docs/16/app-pgamcheck.html", "text": "-t pattern --table= pattern"}}, {"summary": "Exclude tables matching the specified pattern . This option can be specified more than once.", "signature": {"url": "/docs/16/app-pgamcheck.html", "text": "-T pattern --exclude-table= pattern"}}, {"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": {"url": "/docs/16/app-pgamcheck.html", "text": "--no-dependent-indexes"}}, {"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": {"url": "/docs/16/app-pgamcheck.html", "text": "--no-dependent-toast"}}, {"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": {"url": "/docs/16/app-pgamcheck.html", "text": "--no-strict-names"}}, {"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": {"url": "/docs/16/app-pgamcheck.html", "text": "--exclude-toast-pointers"}}, {"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": {"url": "/docs/16/app-pgamcheck.html", "text": "--on-error-stop"}}, {"summary": "If all-frozen is given, table corruption checks will skip over pages in all tables that are marked as all frozen.", "signature": {"url": "/docs/16/app-pgamcheck.html", "text": "--skip= option"}}, {"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": {"url": "/docs/16/app-pgamcheck.html", "text": "--startblock= block"}}, {"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": {"url": "/docs/16/app-pgamcheck.html", "text": "--endblock= block"}}, {"summary": "For each index checked, verify the presence of all heap tuples as index tuples in the index using amcheck 's heapallindexed option.", "signature": {"url": "/docs/16/app-pgamcheck.html", "text": "--heapallindexed"}}, {"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": {"url": "/docs/16/app-pgamcheck.html", "text": "--parent-check"}}, {"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": {"url": "/docs/16/app-pgamcheck.html", "text": "--rootdescend"}}, {"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": {"url": "/docs/16/app-pgamcheck.html", "text": "-h hostname --host= hostname"}}, {"summary": "Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections.", "signature": {"url": "/docs/16/app-pgamcheck.html", "text": "-p port --port= port"}}, {"summary": "User name to connect as.", "signature": {"url": "/docs/16/app-pgamcheck.html", "text": "-U --username= username"}}, {"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": {"url": "/docs/16/app-pgamcheck.html", "text": "-w --no-password"}}, {"summary": "Force pg_amcheck to prompt for a password before connecting to a database.", "signature": {"url": "/docs/16/app-pgamcheck.html", "text": "-W --password"}}, {"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": {"url": "/docs/16/app-pgamcheck.html", "text": "--maintenance-db= dbname"}}, {"summary": "Echo to stdout all SQL sent to the server.", "signature": {"url": "/docs/16/app-pgamcheck.html", "text": "-e --echo"}}, {"summary": "Use num concurrent connections to the server, or one per object to be checked, whichever is less.", "signature": {"url": "/docs/16/app-pgamcheck.html", "text": "-j num --jobs= num"}}, {"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": {"url": "/docs/16/app-pgamcheck.html", "text": "-P --progress"}}, {"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": {"url": "/docs/16/app-pgamcheck.html", "text": "-v --verbose"}}, {"summary": "Print the pg_amcheck version and exit.", "signature": {"url": "/docs/16/app-pgamcheck.html", "text": "-V --version"}}, {"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": {"url": "/docs/16/app-pgamcheck.html", "text": "--install-missing --install-missing= schema"}}, {"summary": "Show help about pg_amcheck command line arguments, and exit.", "signature": {"url": "/docs/16/app-pgamcheck.html", "text": "-? --help"}}], "title": "Documented options", "columns": [{"key": "signature", "label": "Option and arguments"}, {"key": "summary", "label": "Description"}]}], "options": [{"names": ["-a", "--all"], "summary": "Check all databases, except for any excluded via --exclude-database .", "signature": "-a --all", "source_url": "/docs/16/app-pgamcheck.html", "description": "Check all databases, except for any excluded via --exclude-database ."}, {"names": ["-d pattern", "--database= pattern"], "summary": "Check databases matching the specified pattern , except for any excluded by --exclude-database . This option can be specified more than once.", "signature": "-d pattern --database= pattern", "source_url": "/docs/16/app-pgamcheck.html", "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", "--exclude-database= pattern"], "summary": "Exclude databases matching the given pattern . This option can be specified more than once.", "signature": "-D pattern --exclude-database= pattern", "source_url": "/docs/16/app-pgamcheck.html", "description": "Exclude databases matching the given pattern . This option can be specified more than once."}, {"names": ["-i pattern", "--index= pattern"], "summary": "Check indexes matching the specified pattern , unless they are otherwise excluded. This option can be specified more than once.", "signature": "-i pattern --index= pattern", "source_url": "/docs/16/app-pgamcheck.html", "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", "--exclude-index= pattern"], "summary": "Exclude indexes matching the specified pattern . This option can be specified more than once.", "signature": "-I pattern --exclude-index= pattern", "source_url": "/docs/16/app-pgamcheck.html", "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": ["-r pattern", "--relation= pattern"], "summary": "Check relations matching the specified pattern , unless they are otherwise excluded. This option can be specified more than once.", "signature": "-r pattern --relation= pattern", "source_url": "/docs/16/app-pgamcheck.html", "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", "--exclude-relation= pattern"], "summary": "Exclude relations matching the specified pattern . This option can be specified more than once.", "signature": "-R pattern --exclude-relation= pattern", "source_url": "/docs/16/app-pgamcheck.html", "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": ["-s pattern", "--schema= pattern"], "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": "-s pattern --schema= pattern", "source_url": "/docs/16/app-pgamcheck.html", "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", "--exclude-schema= pattern"], "summary": "Exclude tables and indexes in schemas matching the specified pattern . This option can be specified more than once.", "signature": "-S pattern --exclude-schema= pattern", "source_url": "/docs/16/app-pgamcheck.html", "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": ["-t pattern", "--table= pattern"], "summary": "Check tables matching the specified pattern , unless they are otherwise excluded. This option can be specified more than once.", "signature": "-t pattern --table= pattern", "source_url": "/docs/16/app-pgamcheck.html", "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", "--exclude-table= pattern"], "summary": "Exclude tables matching the specified pattern . This option can be specified more than once.", "signature": "-T pattern --exclude-table= pattern", "source_url": "/docs/16/app-pgamcheck.html", "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": ["--no-dependent-indexes"], "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": "--no-dependent-indexes", "source_url": "/docs/16/app-pgamcheck.html", "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-toast"], "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": "--no-dependent-toast", "source_url": "/docs/16/app-pgamcheck.html", "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-strict-names"], "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": "--no-strict-names", "source_url": "/docs/16/app-pgamcheck.html", "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": ["--exclude-toast-pointers"], "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": "--exclude-toast-pointers", "source_url": "/docs/16/app-pgamcheck.html", "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": ["--on-error-stop"], "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": "--on-error-stop", "source_url": "/docs/16/app-pgamcheck.html", "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": ["--skip= option"], "summary": "If all-frozen is given, table corruption checks will skip over pages in all tables that are marked as all frozen.", "signature": "--skip= option", "source_url": "/docs/16/app-pgamcheck.html", "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": ["--startblock= block"], "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": "--startblock= block", "source_url": "/docs/16/app-pgamcheck.html", "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": ["--endblock= block"], "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": "--endblock= block", "source_url": "/docs/16/app-pgamcheck.html", "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": ["--heapallindexed"], "summary": "For each index checked, verify the presence of all heap tuples as index tuples in the index using amcheck 's heapallindexed option.", "signature": "--heapallindexed", "source_url": "/docs/16/app-pgamcheck.html", "description": "For each index checked, verify the presence of all heap tuples as index tuples in the index using amcheck 's heapallindexed option."}, {"names": ["--parent-check"], "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": "--parent-check", "source_url": "/docs/16/app-pgamcheck.html", "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": ["--rootdescend"], "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": "--rootdescend", "source_url": "/docs/16/app-pgamcheck.html", "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": ["-h hostname", "--host= hostname"], "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": "-h hostname --host= hostname", "source_url": "/docs/16/app-pgamcheck.html", "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": ["-p port", "--port= port"], "summary": "Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections.", "signature": "-p port --port= port", "source_url": "/docs/16/app-pgamcheck.html", "description": "Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections."}, {"names": ["-U", "--username= username"], "summary": "User name to connect as.", "signature": "-U --username= username", "source_url": "/docs/16/app-pgamcheck.html", "description": "User name to connect as."}, {"names": ["-w", "--no-password"], "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": "-w --no-password", "source_url": "/docs/16/app-pgamcheck.html", "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", "--password"], "summary": "Force pg_amcheck to prompt for a password before connecting to a database.", "signature": "-W --password", "source_url": "/docs/16/app-pgamcheck.html", "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": ["--maintenance-db= dbname"], "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": "--maintenance-db= dbname", "source_url": "/docs/16/app-pgamcheck.html", "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": ["-e", "--echo"], "summary": "Echo to stdout all SQL sent to the server.", "signature": "-e --echo", "source_url": "/docs/16/app-pgamcheck.html", "description": "Echo to stdout all SQL sent to the server."}, {"names": ["-j num", "--jobs= num"], "summary": "Use num concurrent connections to the server, or one per object to be checked, whichever is less.", "signature": "-j num --jobs= num", "source_url": "/docs/16/app-pgamcheck.html", "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": ["-P", "--progress"], "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": "-P --progress", "source_url": "/docs/16/app-pgamcheck.html", "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": ["-v", "--verbose"], "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": "-v --verbose", "source_url": "/docs/16/app-pgamcheck.html", "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", "--version"], "summary": "Print the pg_amcheck version and exit.", "signature": "-V --version", "source_url": "/docs/16/app-pgamcheck.html", "description": "Print the pg_amcheck version and exit."}, {"names": ["--install-missing", "--install-missing= schema"], "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": "--install-missing --install-missing= schema", "source_url": "/docs/16/app-pgamcheck.html", "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": ["-?", "--help"], "summary": "Show help about pg_amcheck command line arguments, and exit.", "signature": "-? --help", "source_url": "/docs/16/app-pgamcheck.html", "description": "Show help about pg_amcheck command line arguments, and exit."}], "related": [], "release": {"ref": "https://ftp.postgresql.org/pub/source/v16.15/postgresql-16.15.tar.bz2", "label": "16.15", "major": "16", "channel": "stable", "manifest": {"pdf": {"A4": {"url": "/files/documentation/pdf/16/postgresql-16-A4.pdf", "bytes": 15282337, "pages": 3055, "sha256": "4bb6c1f63deedac98736d8c4c7bc0fad0ac24e85b07e21ee10411872f06afd06", "built_at": "2026-09-26"}, "US": {"url": "/files/documentation/pdf/16/postgresql-16-US.pdf", "bytes": 15164148, "pages": 3220, "sha256": "5b6b6166c89991199e144bb0ae34c17a5f29826251dbf19db1abc0df3a3e771b", "built_at": "2026-09-26"}}, "tree": "16", "index": "index.html", "major": "16", "pages": 1169, "release": "16.15", "source_url": "https://ftp.postgresql.org/pub/source/v16.15/postgresql-16.15.tar.bz2", "svg_assets": 3, "source_mode": "en HTML verified against the pinned official archive", "source_sha256": "c1575341fa7bd40f5274ea465b34390f4dc64cdd0770af327005caaeb9f6b7ed"}, "revision": "3c21e58b35318021716440e67bb8bafd392b6a2b965a244d90e9e33c99e0bdef", "evidence_kind": "English manual and source declarations", "source_sha256": "c1575341fa7bd40f5274ea465b34390f4dc64cdd0770af327005caaeb9f6b7ed"}, "sources": [{"url": "/docs/16/app-pgamcheck.html", "file": "app-pgamcheck.html", "label": "16.15 English manual \u00b7 app-pgamcheck.html", "anchor": "", "sha256": "33a8078855a33639b6ba7d792447c2626332a9dcd47c6592ad824994b21dfbe7"}, {"url": "/docs/16/reference-client.html", "file": "reference-client.html", "label": "Client applications inventory", "anchor": "", "sha256": "a28c30c3c0f8783e16d56413a0b6fd39487e336da1683b29b60abf1c229cef26"}], "sections": [], "synopsis": ["pg_amcheck [ option ...] [ dbname ]"], "signature": "pg_amcheck [ option ...] [ dbname ]", "description": ["pg_amcheck \u2014 checks for corruption in one or more PostgreSQL databases"], "environment": [], "manual_html": "<div><div class=\"refentry\" id=\"APP-PGAMCHECK\">\n<div class=\"titlepage\"></div>\n<div class=\"refnamediv\">\n<h2><span class=\"refentrytitle\"><span class=\"application\">pg_amcheck</span></span></h2>\n<p>pg_amcheck \u2014 checks for corruption in one or more <span class=\"productname\">PostgreSQL</span> databases</p>\n</div>\n<div class=\"refsynopsisdiv\">\n<h2>Synopsis</h2>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.4.9.4.1\"><code class=\"command\">pg_amcheck</code> [<em class=\"replaceable\"><code>option</code></em>...] [<em class=\"replaceable\"><code>dbname</code></em>]</p>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.4.9.5\">\n<h2>Description</h2>\n<p><span class=\"application\">pg_amcheck</span> supports running <a class=\"xref\" href=\"/docs/16/amcheck.html\" title=\"F.2.\u00a0amcheck \u2014 tools to verify table and index consistency\">amcheck</a>'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.</p>\n<p>Only ordinary and toast table relations, materialized views, sequences, and btree indexes are currently supported. Other relation types are silently skipped.</p>\n<p>If <code class=\"literal\">dbname</code> 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 <code class=\"option\">--all</code>, <code class=\"option\">--database</code> and <code class=\"option\">--exclude-database</code>. They also include <code class=\"option\">--relation</code>, <code class=\"option\">--exclude-relation</code>, <code class=\"option\">--table</code>, <code class=\"option\">--exclude-table</code>, <code class=\"option\">--index</code>, and <code class=\"option\">--exclude-index</code>, but only when such options are used with a three-part pattern (e.g. <code class=\"option\">mydb*.myschema*.myrel*</code>). Finally, they include <code class=\"option\">--schema</code> and <code class=\"option\">--exclude-schema</code> when such options are used with a two-part pattern (e.g. <code class=\"option\">mydb*.myschema*</code>).</p>\n<p><em class=\"replaceable\"><code>dbname</code></em> can also be a <a class=\"link\" href=\"/docs/16/libpq-connect.html#LIBPQ-CONNSTRING\" title=\"34.1.1.\u00a0Connection Strings\">connection string</a>.</p>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.4.9.6\">\n<h2>Options</h2>\n<p>The following command-line options control what is checked:</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-a</code><br></span><span class=\"term\"><code class=\"option\">--all</code></span></dt>\n<dd>\n<p>Check all databases, except for any excluded via <code class=\"option\">--exclude-database</code>.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-d <em class=\"replaceable\"><code>pattern</code></em></code><br></span><span class=\"term\"><code class=\"option\">--database=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p>Check databases matching the specified <a class=\"link\" href=\"/docs/16/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"><em class=\"replaceable\"><code>pattern</code></em></a>, except for any excluded by <code class=\"option\">--exclude-database</code>. This option can be specified more than once.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-D <em class=\"replaceable\"><code>pattern</code></em></code><br></span><span class=\"term\"><code class=\"option\">--exclude-database=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p>Exclude databases matching the given <a class=\"link\" href=\"/docs/16/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"><em class=\"replaceable\"><code>pattern</code></em></a>. This option can be specified more than once.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-i <em class=\"replaceable\"><code>pattern</code></em></code><br></span><span class=\"term\"><code class=\"option\">--index=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p>Check indexes matching the specified <a class=\"link\" href=\"/docs/16/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"><em class=\"replaceable\"><code>pattern</code></em></a>, unless they are otherwise excluded. This option can be specified more than once.</p>\n<p>This is similar to the <code class=\"option\">--relation</code> option, except that it applies only to indexes, not to other relation types.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-I <em class=\"replaceable\"><code>pattern</code></em></code><br></span><span class=\"term\"><code class=\"option\">--exclude-index=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p>Exclude indexes matching the specified <a class=\"link\" href=\"/docs/16/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"><em class=\"replaceable\"><code>pattern</code></em></a>. This option can be specified more than once.</p>\n<p>This is similar to the <code class=\"option\">--exclude-relation</code> option, except that it applies only to indexes, not other relation types.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-r <em class=\"replaceable\"><code>pattern</code></em></code><br></span><span class=\"term\"><code class=\"option\">--relation=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p>Check relations matching the specified <a class=\"link\" href=\"/docs/16/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"><em class=\"replaceable\"><code>pattern</code></em></a>, unless they are otherwise excluded. This option can be specified more than once.</p>\n<p>Patterns may be unqualified, e.g. <code class=\"literal\">myrel*</code>, or they may be schema-qualified, e.g. <code class=\"literal\">myschema*.myrel*</code> or database-qualified and schema-qualified, e.g. <code class=\"literal\">mydb*.myschema*.myrel*</code>. A database-qualified pattern will add matching databases to the list of databases to be checked.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-R <em class=\"replaceable\"><code>pattern</code></em></code><br></span><span class=\"term\"><code class=\"option\">--exclude-relation=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p>Exclude relations matching the specified <a class=\"link\" href=\"/docs/16/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"><em class=\"replaceable\"><code>pattern</code></em></a>. This option can be specified more than once.</p>\n<p>As with <code class=\"option\">--relation</code>, the <a class=\"link\" href=\"/docs/16/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"><em class=\"replaceable\"><code>pattern</code></em></a> may be unqualified, schema-qualified, or database- and schema-qualified.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-s <em class=\"replaceable\"><code>pattern</code></em></code><br></span><span class=\"term\"><code class=\"option\">--schema=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p>Check tables and indexes in schemas matching the specified <a class=\"link\" href=\"/docs/16/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"><em class=\"replaceable\"><code>pattern</code></em></a>, unless they are otherwise excluded. This option can be specified more than once.</p>\n<p>To select only tables in schemas matching a particular pattern, consider using something like <code class=\"literal\">--table=SCHEMAPAT.* --no-dependent-indexes</code>. To select only indexes, consider using something like <code class=\"literal\">--index=SCHEMAPAT.*</code>.</p>\n<p>A schema pattern may be database-qualified. For example, you may write <code class=\"literal\">--schema=mydb*.myschema*</code> to select schemas matching <code class=\"literal\">myschema*</code> in databases matching <code class=\"literal\">mydb*</code>.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-S <em class=\"replaceable\"><code>pattern</code></em></code><br></span><span class=\"term\"><code class=\"option\">--exclude-schema=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p>Exclude tables and indexes in schemas matching the specified <a class=\"link\" href=\"/docs/16/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"><em class=\"replaceable\"><code>pattern</code></em></a>. This option can be specified more than once.</p>\n<p>As with <code class=\"option\">--schema</code>, the pattern may be database-qualified.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-t <em class=\"replaceable\"><code>pattern</code></em></code><br></span><span class=\"term\"><code class=\"option\">--table=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p>Check tables matching the specified <a class=\"link\" href=\"/docs/16/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"><em class=\"replaceable\"><code>pattern</code></em></a>, unless they are otherwise excluded. This option can be specified more than once.</p>\n<p>This is similar to the <code class=\"option\">--relation</code> option, except that it applies only to tables, materialized views, and sequences, not to indexes.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-T <em class=\"replaceable\"><code>pattern</code></em></code><br></span><span class=\"term\"><code class=\"option\">--exclude-table=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p>Exclude tables matching the specified <a class=\"link\" href=\"/docs/16/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"><em class=\"replaceable\"><code>pattern</code></em></a>. This option can be specified more than once.</p>\n<p>This is similar to the <code class=\"option\">--exclude-relation</code> option, except that it applies only to tables, materialized views, and sequences, not to indexes.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-dependent-indexes</code></span></dt>\n<dd>\n<p>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 <code class=\"literal\">--index</code> or <code class=\"literal\">--relation</code>. This option suppresses that behavior.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-dependent-toast</code></span></dt>\n<dd>\n<p>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 <code class=\"literal\">--table</code> or <code class=\"literal\">--relation</code>. This option suppresses that behavior.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-strict-names</code></span></dt>\n<dd>\n<p>By default, if an argument to <code class=\"literal\">--database</code>, <code class=\"literal\">--table</code>, <code class=\"literal\">--index</code>, or <code class=\"literal\">--relation</code> matches no objects, it is a fatal error. This option downgrades that error to a warning.</p>\n</dd>\n</dl>\n</div>\n<p>The following command-line options control checking of tables:</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">--exclude-toast-pointers</code></span></dt>\n<dd>\n<p>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.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--on-error-stop</code></span></dt>\n<dd>\n<p>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.</p>\n<p>Note that index checking always stops after the first corrupt page. This option only has meaning relative to table relations.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--skip=<em class=\"replaceable\"><code>option</code></em></code></span></dt>\n<dd>\n<p>If <code class=\"literal\">all-frozen</code> is given, table corruption checks will skip over pages in all tables that are marked as all frozen.</p>\n<p>If <code class=\"literal\">all-visible</code> is given, table corruption checks will skip over pages in all tables that are marked as all visible.</p>\n<p>By default, no pages are skipped. This can be specified as <code class=\"literal\">none</code>, but since this is the default, it need not be mentioned.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--startblock=<em class=\"replaceable\"><code>block</code></em></code></span></dt>\n<dd>\n<p>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 <code class=\"literal\">--endblock</code> for further caveats.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--endblock=<em class=\"replaceable\"><code>block</code></em></code></span></dt>\n<dd>\n<p>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 <code class=\"option\">--exclude-toast-pointers</code>.</p>\n</dd>\n</dl>\n</div>\n<p>The following command-line options control checking of B-tree indexes:</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">--heapallindexed</code></span></dt>\n<dd>\n<p>For each index checked, verify the presence of all heap tuples as index tuples in the index using <a class=\"xref\" href=\"/docs/16/amcheck.html\" title=\"F.2.\u00a0amcheck \u2014 tools to verify table and index consistency\">amcheck</a>'s <code class=\"option\">heapallindexed</code> option.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--parent-check</code></span></dt>\n<dd>\n<p>For each btree index checked, use <a class=\"xref\" href=\"/docs/16/amcheck.html\" title=\"F.2.\u00a0amcheck \u2014 tools to verify table and index consistency\">amcheck</a>'s <code class=\"function\">bt_index_parent_check</code> function, which performs additional checks of parent/child relationships during index checking.</p>\n<p>The default is to use <span class=\"application\">amcheck</span>'s <code class=\"function\">bt_index_check</code> function, but note that use of the <code class=\"option\">--rootdescend</code> option implicitly selects <code class=\"function\">bt_index_parent_check</code>.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--rootdescend</code></span></dt>\n<dd>\n<p>For each index checked, re-find tuples on the leaf level by performing a new search from the root page for each tuple using <a class=\"xref\" href=\"/docs/16/amcheck.html\" title=\"F.2.\u00a0amcheck \u2014 tools to verify table and index consistency\">amcheck</a>'s <code class=\"option\">rootdescend</code> option.</p>\n<p>Use of this option implicitly also selects the <code class=\"option\">--parent-check</code> option.</p>\n<p>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.</p>\n</dd>\n</dl>\n</div>\n<div class=\"warning\">\n<h3 class=\"title\">Warning</h3>\n<p>The extra checks performed against B-tree indexes when the <code class=\"option\">--parent-check</code> option or the <code class=\"option\">--rootdescend</code> option is specified require relatively strong relation-level locks. These checks are the only checks that will block concurrent data modification from <code class=\"command\">INSERT</code>, <code class=\"command\">UPDATE</code>, and <code class=\"command\">DELETE</code> commands.</p>\n</div>\n<p>The following command-line options control the connection to the server:</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-h <em class=\"replaceable\"><code>hostname</code></em></code><br></span><span class=\"term\"><code class=\"option\">--host=<em class=\"replaceable\"><code>hostname</code></em></code></span></dt>\n<dd>\n<p>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.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-p <em class=\"replaceable\"><code>port</code></em></code><br></span><span class=\"term\"><code class=\"option\">--port=<em class=\"replaceable\"><code>port</code></em></code></span></dt>\n<dd>\n<p>Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-U</code><br></span><span class=\"term\"><code class=\"option\">--username=<em class=\"replaceable\"><code>username</code></em></code></span></dt>\n<dd>\n<p>User name to connect as.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-w</code><br></span><span class=\"term\"><code class=\"option\">--no-password</code></span></dt>\n<dd>\n<p>Never issue a password prompt. If the server requires password authentication and a password is not available by other means such as a <code class=\"filename\">.pgpass</code> 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.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-W</code><br></span><span class=\"term\"><code class=\"option\">--password</code></span></dt>\n<dd>\n<p>Force <span class=\"application\">pg_amcheck</span> to prompt for a password before connecting to a database.</p>\n<p>This option is never essential, since <span class=\"application\">pg_amcheck</span> will automatically prompt for a password if the server demands password authentication. However, <span class=\"application\">pg_amcheck</span> will waste a connection attempt finding out that the server wants a password. In some cases it is worth typing <code class=\"option\">-W</code> to avoid the extra connection attempt.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--maintenance-db=<em class=\"replaceable\"><code>dbname</code></em></code></span></dt>\n<dd>\n<p>Specifies a database or <a class=\"link\" href=\"/docs/16/libpq-connect.html#LIBPQ-CONNSTRING\" title=\"34.1.1.\u00a0Connection Strings\">connection string</a> to be used to discover the list of databases to be checked. If neither <code class=\"option\">--all</code> 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 <code class=\"literal\">postgres</code> or, if that fails, <code class=\"literal\">template1</code>.</p>\n</dd>\n</dl>\n</div>\n<p>Other options are also available:</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-e</code><br></span><span class=\"term\"><code class=\"option\">--echo</code></span></dt>\n<dd>\n<p>Echo to stdout all SQL sent to the server.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-j <em class=\"replaceable\"><code>num</code></em></code><br></span><span class=\"term\"><code class=\"option\">--jobs=<em class=\"replaceable\"><code>num</code></em></code></span></dt>\n<dd>\n<p>Use <em class=\"replaceable\"><code>num</code></em> concurrent connections to the server, or one per object to be checked, whichever is less.</p>\n<p>The default is to use a single connection.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-P</code><br></span><span class=\"term\"><code class=\"option\">--progress</code></span></dt>\n<dd>\n<p>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.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-v</code><br></span><span class=\"term\"><code class=\"option\">--verbose</code></span></dt>\n<dd>\n<p>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.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-V</code><br></span><span class=\"term\"><code class=\"option\">--version</code></span></dt>\n<dd>\n<p>Print the <span class=\"application\">pg_amcheck</span> version and exit.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--install-missing</code><br></span><span class=\"term\"><code class=\"option\">--install-missing=<em class=\"replaceable\"><code>schema</code></em></code></span></dt>\n<dd>\n<p>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 <em class=\"replaceable\"><code>schema</code></em>, or if not specified into schema <code class=\"literal\">pg_catalog</code>.</p>\n<p>At present, the only required extension is <a class=\"xref\" href=\"/docs/16/amcheck.html\" title=\"F.2.\u00a0amcheck \u2014 tools to verify table and index consistency\">amcheck</a>.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-?</code><br></span><span class=\"term\"><code class=\"option\">--help</code></span></dt>\n<dd>\n<p>Show help about <span class=\"application\">pg_amcheck</span> command line arguments, and exit.</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.4.9.7\">\n<h2>Notes</h2>\n<p><span class=\"application\">pg_amcheck</span> is designed to work with <span class=\"productname\">PostgreSQL</span> 14.0 and later.</p>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.4.9.8\">\n<h2>See Also</h2><span class=\"simplelist\"><a class=\"xref\" href=\"/docs/16/amcheck.html\" title=\"F.2.\u00a0amcheck \u2014 tools to verify table and index consistency\">amcheck</a></span>\n</div>\n</div></div>", "manual_path": "app-pgamcheck.html", "comparison_data": {"options": [{"names": ["-a", "--all"], "signature": "-a --all", "description": "Check all databases, except for any excluded via --exclude-database ."}, {"names": ["-d pattern", "--database= pattern"], "signature": "-d pattern --database= pattern", "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", "--exclude-database= pattern"], "signature": "-D pattern --exclude-database= pattern", "description": "Exclude databases matching the given pattern . This option can be specified more than once."}, {"names": ["-i pattern", "--index= pattern"], "signature": "-i pattern --index= 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", "--exclude-index= pattern"], "signature": "-I pattern --exclude-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": ["-r pattern", "--relation= pattern"], "signature": "-r pattern --relation= 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", "--exclude-relation= pattern"], "signature": "-R pattern --exclude-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": ["-s pattern", "--schema= pattern"], "signature": "-s pattern --schema= 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", "--exclude-schema= pattern"], "signature": "-S pattern --exclude-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": ["-t pattern", "--table= pattern"], "signature": "-t pattern --table= 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", "--exclude-table= pattern"], "signature": "-T pattern --exclude-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": ["--no-dependent-indexes"], "signature": "--no-dependent-indexes", "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-toast"], "signature": "--no-dependent-toast", "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-strict-names"], "signature": "--no-strict-names", "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": ["--exclude-toast-pointers"], "signature": "--exclude-toast-pointers", "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": ["--on-error-stop"], "signature": "--on-error-stop", "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": ["--skip= option"], "signature": "--skip= option", "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": ["--startblock= block"], "signature": "--startblock= block", "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": ["--endblock= block"], "signature": "--endblock= 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": ["--heapallindexed"], "signature": "--heapallindexed", "description": "For each index checked, verify the presence of all heap tuples as index tuples in the index using amcheck 's heapallindexed option."}, {"names": ["--parent-check"], "signature": "--parent-check", "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": ["--rootdescend"], "signature": "--rootdescend", "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": ["-h hostname", "--host= hostname"], "signature": "-h hostname --host= hostname", "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": ["-p port", "--port= port"], "signature": "-p port --port= port", "description": "Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections."}, {"names": ["-U", "--username= username"], "signature": "-U --username= username", "description": "User name to connect as."}, {"names": ["-w", "--no-password"], "signature": "-w --no-password", "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", "--password"], "signature": "-W --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": ["--maintenance-db= dbname"], "signature": "--maintenance-db= dbname", "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": ["-e", "--echo"], "signature": "-e --echo", "description": "Echo to stdout all SQL sent to the server."}, {"names": ["-j num", "--jobs= num"], "signature": "-j num --jobs= num", "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": ["-P", "--progress"], "signature": "-P --progress", "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": ["-v", "--verbose"], "signature": "-v --verbose", "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", "--version"], "signature": "-V --version", "description": "Print the pg_amcheck version and exit."}, {"names": ["--install-missing", "--install-missing= schema"], "signature": "--install-missing --install-missing= schema", "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": ["-?", "--help"], "signature": "-? --help", "description": "Show help about pg_amcheck command line arguments, and exit."}], "synopsis": ["pg_amcheck [ option ...] [ dbname ]"], "environment": []}, "comparison_hash": "27fb7b188a266efb8574a81e72c1b428521ad8791ecacdbdd7d7221e5e1cf058"}, "17": {"facts": [{"label": "Documented executable", "value": "pg_amcheck"}, {"label": "Executable version", "value": "17.11"}, {"label": "Reference inventory", "value": "Client applications"}, {"label": "Option definition groups", "value": "36"}], "tables": [{"key": "options", "rows": [{"summary": "Check all databases, except for any excluded via --exclude-database .", "signature": {"url": "/docs/17/app-pgamcheck.html", "text": "-a --all"}}, {"summary": "Check databases matching the specified pattern , except for any excluded by --exclude-database . This option can be specified more than once.", "signature": {"url": "/docs/17/app-pgamcheck.html", "text": "-d pattern --database= pattern"}}, {"summary": "Exclude databases matching the given pattern . This option can be specified more than once.", "signature": {"url": "/docs/17/app-pgamcheck.html", "text": "-D pattern --exclude-database= pattern"}}, {"summary": "Check indexes matching the specified pattern , unless they are otherwise excluded. This option can be specified more than once.", "signature": {"url": "/docs/17/app-pgamcheck.html", "text": "-i pattern --index= pattern"}}, {"summary": "Exclude indexes matching the specified pattern . This option can be specified more than once.", "signature": {"url": "/docs/17/app-pgamcheck.html", "text": "-I pattern --exclude-index= pattern"}}, {"summary": "Check relations matching the specified pattern , unless they are otherwise excluded. This option can be specified more than once.", "signature": {"url": "/docs/17/app-pgamcheck.html", "text": "-r pattern --relation= pattern"}}, {"summary": "Exclude relations matching the specified pattern . This option can be specified more than once.", "signature": {"url": "/docs/17/app-pgamcheck.html", "text": "-R pattern --exclude-relation= pattern"}}, {"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": {"url": "/docs/17/app-pgamcheck.html", "text": "-s pattern --schema= pattern"}}, {"summary": "Exclude tables and indexes in schemas matching the specified pattern . This option can be specified more than once.", "signature": {"url": "/docs/17/app-pgamcheck.html", "text": "-S pattern --exclude-schema= pattern"}}, {"summary": "Check tables matching the specified pattern , unless they are otherwise excluded. This option can be specified more than once.", "signature": {"url": "/docs/17/app-pgamcheck.html", "text": "-t pattern --table= pattern"}}, {"summary": "Exclude tables matching the specified pattern . This option can be specified more than once.", "signature": {"url": "/docs/17/app-pgamcheck.html", "text": "-T pattern --exclude-table= pattern"}}, {"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": {"url": "/docs/17/app-pgamcheck.html", "text": "--no-dependent-indexes"}}, {"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": {"url": "/docs/17/app-pgamcheck.html", "text": "--no-dependent-toast"}}, {"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": {"url": "/docs/17/app-pgamcheck.html", "text": "--no-strict-names"}}, {"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": {"url": "/docs/17/app-pgamcheck.html", "text": "--exclude-toast-pointers"}}, {"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": {"url": "/docs/17/app-pgamcheck.html", "text": "--on-error-stop"}}, {"summary": "If all-frozen is given, table corruption checks will skip over pages in all tables that are marked as all frozen.", "signature": {"url": "/docs/17/app-pgamcheck.html", "text": "--skip= option"}}, {"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": {"url": "/docs/17/app-pgamcheck.html", "text": "--startblock= block"}}, {"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": {"url": "/docs/17/app-pgamcheck.html", "text": "--endblock= block"}}, {"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": {"url": "/docs/17/app-pgamcheck.html", "text": "--checkunique"}}, {"summary": "For each index checked, verify the presence of all heap tuples as index tuples in the index using amcheck 's heapallindexed option.", "signature": {"url": "/docs/17/app-pgamcheck.html", "text": "--heapallindexed"}}, {"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": {"url": "/docs/17/app-pgamcheck.html", "text": "--parent-check"}}, {"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": {"url": "/docs/17/app-pgamcheck.html", "text": "--rootdescend"}}, {"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": {"url": "/docs/17/app-pgamcheck.html", "text": "-h hostname --host= hostname"}}, {"summary": "Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections.", "signature": {"url": "/docs/17/app-pgamcheck.html", "text": "-p port --port= port"}}, {"summary": "User name to connect as.", "signature": {"url": "/docs/17/app-pgamcheck.html", "text": "-U --username= username"}}, {"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": {"url": "/docs/17/app-pgamcheck.html", "text": "-w --no-password"}}, {"summary": "Force pg_amcheck to prompt for a password before connecting to a database.", "signature": {"url": "/docs/17/app-pgamcheck.html", "text": "-W --password"}}, {"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": {"url": "/docs/17/app-pgamcheck.html", "text": "--maintenance-db= dbname"}}, {"summary": "Echo to stdout all SQL sent to the server.", "signature": {"url": "/docs/17/app-pgamcheck.html", "text": "-e --echo"}}, {"summary": "Use num concurrent connections to the server, or one per object to be checked, whichever is less.", "signature": {"url": "/docs/17/app-pgamcheck.html", "text": "-j num --jobs= num"}}, {"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": {"url": "/docs/17/app-pgamcheck.html", "text": "-P --progress"}}, {"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": {"url": "/docs/17/app-pgamcheck.html", "text": "-v --verbose"}}, {"summary": "Print the pg_amcheck version and exit.", "signature": {"url": "/docs/17/app-pgamcheck.html", "text": "-V --version"}}, {"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": {"url": "/docs/17/app-pgamcheck.html", "text": "--install-missing --install-missing= schema"}}, {"summary": "Show help about pg_amcheck command line arguments, and exit.", "signature": {"url": "/docs/17/app-pgamcheck.html", "text": "-? --help"}}], "title": "Documented options", "columns": [{"key": "signature", "label": "Option and arguments"}, {"key": "summary", "label": "Description"}]}], "options": [{"names": ["-a", "--all"], "summary": "Check all databases, except for any excluded via --exclude-database .", "signature": "-a --all", "source_url": "/docs/17/app-pgamcheck.html", "description": "Check all databases, except for any excluded via --exclude-database ."}, {"names": ["-d pattern", "--database= pattern"], "summary": "Check databases matching the specified pattern , except for any excluded by --exclude-database . This option can be specified more than once.", "signature": "-d pattern --database= pattern", "source_url": "/docs/17/app-pgamcheck.html", "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", "--exclude-database= pattern"], "summary": "Exclude databases matching the given pattern . This option can be specified more than once.", "signature": "-D pattern --exclude-database= pattern", "source_url": "/docs/17/app-pgamcheck.html", "description": "Exclude databases matching the given pattern . This option can be specified more than once."}, {"names": ["-i pattern", "--index= pattern"], "summary": "Check indexes matching the specified pattern , unless they are otherwise excluded. This option can be specified more than once.", "signature": "-i pattern --index= pattern", "source_url": "/docs/17/app-pgamcheck.html", "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", "--exclude-index= pattern"], "summary": "Exclude indexes matching the specified pattern . This option can be specified more than once.", "signature": "-I pattern --exclude-index= pattern", "source_url": "/docs/17/app-pgamcheck.html", "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": ["-r pattern", "--relation= pattern"], "summary": "Check relations matching the specified pattern , unless they are otherwise excluded. This option can be specified more than once.", "signature": "-r pattern --relation= pattern", "source_url": "/docs/17/app-pgamcheck.html", "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", "--exclude-relation= pattern"], "summary": "Exclude relations matching the specified pattern . This option can be specified more than once.", "signature": "-R pattern --exclude-relation= pattern", "source_url": "/docs/17/app-pgamcheck.html", "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": ["-s pattern", "--schema= pattern"], "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": "-s pattern --schema= pattern", "source_url": "/docs/17/app-pgamcheck.html", "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", "--exclude-schema= pattern"], "summary": "Exclude tables and indexes in schemas matching the specified pattern . This option can be specified more than once.", "signature": "-S pattern --exclude-schema= pattern", "source_url": "/docs/17/app-pgamcheck.html", "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": ["-t pattern", "--table= pattern"], "summary": "Check tables matching the specified pattern , unless they are otherwise excluded. This option can be specified more than once.", "signature": "-t pattern --table= pattern", "source_url": "/docs/17/app-pgamcheck.html", "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", "--exclude-table= pattern"], "summary": "Exclude tables matching the specified pattern . This option can be specified more than once.", "signature": "-T pattern --exclude-table= pattern", "source_url": "/docs/17/app-pgamcheck.html", "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": ["--no-dependent-indexes"], "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": "--no-dependent-indexes", "source_url": "/docs/17/app-pgamcheck.html", "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-toast"], "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": "--no-dependent-toast", "source_url": "/docs/17/app-pgamcheck.html", "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-strict-names"], "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": "--no-strict-names", "source_url": "/docs/17/app-pgamcheck.html", "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": ["--exclude-toast-pointers"], "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": "--exclude-toast-pointers", "source_url": "/docs/17/app-pgamcheck.html", "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": ["--on-error-stop"], "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": "--on-error-stop", "source_url": "/docs/17/app-pgamcheck.html", "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": ["--skip= option"], "summary": "If all-frozen is given, table corruption checks will skip over pages in all tables that are marked as all frozen.", "signature": "--skip= option", "source_url": "/docs/17/app-pgamcheck.html", "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": ["--startblock= block"], "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": "--startblock= block", "source_url": "/docs/17/app-pgamcheck.html", "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": ["--endblock= block"], "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": "--endblock= block", "source_url": "/docs/17/app-pgamcheck.html", "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": ["--checkunique"], "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": "--checkunique", "source_url": "/docs/17/app-pgamcheck.html", "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": ["--heapallindexed"], "summary": "For each index checked, verify the presence of all heap tuples as index tuples in the index using amcheck 's heapallindexed option.", "signature": "--heapallindexed", "source_url": "/docs/17/app-pgamcheck.html", "description": "For each index checked, verify the presence of all heap tuples as index tuples in the index using amcheck 's heapallindexed option."}, {"names": ["--parent-check"], "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": "--parent-check", "source_url": "/docs/17/app-pgamcheck.html", "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": ["--rootdescend"], "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": "--rootdescend", "source_url": "/docs/17/app-pgamcheck.html", "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": ["-h hostname", "--host= hostname"], "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": "-h hostname --host= hostname", "source_url": "/docs/17/app-pgamcheck.html", "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": ["-p port", "--port= port"], "summary": "Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections.", "signature": "-p port --port= port", "source_url": "/docs/17/app-pgamcheck.html", "description": "Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections."}, {"names": ["-U", "--username= username"], "summary": "User name to connect as.", "signature": "-U --username= username", "source_url": "/docs/17/app-pgamcheck.html", "description": "User name to connect as."}, {"names": ["-w", "--no-password"], "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": "-w --no-password", "source_url": "/docs/17/app-pgamcheck.html", "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", "--password"], "summary": "Force pg_amcheck to prompt for a password before connecting to a database.", "signature": "-W --password", "source_url": "/docs/17/app-pgamcheck.html", "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": ["--maintenance-db= dbname"], "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": "--maintenance-db= dbname", "source_url": "/docs/17/app-pgamcheck.html", "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": ["-e", "--echo"], "summary": "Echo to stdout all SQL sent to the server.", "signature": "-e --echo", "source_url": "/docs/17/app-pgamcheck.html", "description": "Echo to stdout all SQL sent to the server."}, {"names": ["-j num", "--jobs= num"], "summary": "Use num concurrent connections to the server, or one per object to be checked, whichever is less.", "signature": "-j num --jobs= num", "source_url": "/docs/17/app-pgamcheck.html", "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": ["-P", "--progress"], "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": "-P --progress", "source_url": "/docs/17/app-pgamcheck.html", "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": ["-v", "--verbose"], "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": "-v --verbose", "source_url": "/docs/17/app-pgamcheck.html", "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", "--version"], "summary": "Print the pg_amcheck version and exit.", "signature": "-V --version", "source_url": "/docs/17/app-pgamcheck.html", "description": "Print the pg_amcheck version and exit."}, {"names": ["--install-missing", "--install-missing= schema"], "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": "--install-missing --install-missing= schema", "source_url": "/docs/17/app-pgamcheck.html", "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": ["-?", "--help"], "summary": "Show help about pg_amcheck command line arguments, and exit.", "signature": "-? --help", "source_url": "/docs/17/app-pgamcheck.html", "description": "Show help about pg_amcheck command line arguments, and exit."}], "related": [], "release": {"ref": "https://ftp.postgresql.org/pub/source/v17.11/postgresql-17.11.tar.bz2", "label": "17.11", "major": "17", "channel": "stable", "manifest": {"pdf": {"A4": {"url": "/files/documentation/pdf/17/postgresql-17-A4.pdf", "bytes": 15521293, "pages": 3099, "sha256": "1991354df0dc89e70ec39328c28988ef8b19c6a93671dab3893650b63e9f4e36", "built_at": "2026-09-26"}, "US": {"url": "/files/documentation/pdf/17/postgresql-17-US.pdf", "bytes": 15398150, "pages": 3270, "sha256": "07696c8f38abf31babf22d2db337093936e7c472d2af36d050b000c49bbcf52c", "built_at": "2026-09-26"}}, "tree": "17", "index": "index.html", "major": "17", "pages": 1143, "release": "17.11", "source_url": "https://ftp.postgresql.org/pub/source/v17.11/postgresql-17.11.tar.bz2", "svg_assets": 3, "source_mode": "en SGML built with pinned official archive", "source_sha256": "dd27f2b3c59e73ed14aa3324901242bf69a032a6347805f274e6260322d42979"}, "revision": "58419c9b0dd42cb34c8d53695bb025a7e582edf55ccd4c5bcb1c2c7c71a37487", "evidence_kind": "English manual and source declarations", "source_sha256": "dd27f2b3c59e73ed14aa3324901242bf69a032a6347805f274e6260322d42979"}, "sources": [{"url": "/docs/17/app-pgamcheck.html", "file": "app-pgamcheck.html", "label": "17.11 English manual \u00b7 app-pgamcheck.html", "anchor": "", "sha256": "7f6ac93be2812870a23b8686c1865278c1bb7d81bad638b2bc975b9b23ecb4ff"}, {"url": "/docs/17/reference-client.html", "file": "reference-client.html", "label": "Client applications inventory", "anchor": "", "sha256": "3194fc72ddad8e2fcba55f8e007f83413cb352146cb65aaa9457a18d0314ee1b"}], "sections": [], "synopsis": ["pg_amcheck [ option ...] [ dbname ]"], "signature": "pg_amcheck [ option ...] [ dbname ]", "description": ["pg_amcheck \u2014 checks for corruption in one or more PostgreSQL databases"], "environment": [], "manual_html": "<div><div class=\"refentry\" id=\"APP-PGAMCHECK\">\n<div class=\"titlepage\"></div>\n<div class=\"refnamediv\">\n<h2><span class=\"refentrytitle\"><span class=\"application\">pg_amcheck</span></span></h2>\n<p>pg_amcheck \u2014 checks for corruption in one or more <span class=\"productname\">PostgreSQL</span> databases</p>\n</div>\n<div class=\"refsynopsisdiv\">\n<h2>Synopsis</h2>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.4.9.4.1\"><code class=\"command\">pg_amcheck</code> [<em class=\"replaceable\"><code>option</code></em>...] [<em class=\"replaceable\"><code>dbname</code></em>]</p>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.4.9.5\">\n<h2>Description</h2>\n<p><span class=\"application\">pg_amcheck</span> supports running <a class=\"xref\" href=\"/docs/17/amcheck.html\" title=\"F.1.\u00a0amcheck \u2014 tools to verify table and index consistency\">amcheck</a>'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.</p>\n<p>Only ordinary and toast table relations, materialized views, sequences, and btree indexes are currently supported. Other relation types are silently skipped.</p>\n<p>If <code class=\"literal\">dbname</code> 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 <code class=\"option\">--all</code>, <code class=\"option\">--database</code> and <code class=\"option\">--exclude-database</code>. They also include <code class=\"option\">--relation</code>, <code class=\"option\">--exclude-relation</code>, <code class=\"option\">--table</code>, <code class=\"option\">--exclude-table</code>, <code class=\"option\">--index</code>, and <code class=\"option\">--exclude-index</code>, but only when such options are used with a three-part pattern (e.g. <code class=\"option\">mydb*.myschema*.myrel*</code>). Finally, they include <code class=\"option\">--schema</code> and <code class=\"option\">--exclude-schema</code> when such options are used with a two-part pattern (e.g. <code class=\"option\">mydb*.myschema*</code>).</p>\n<p><em class=\"replaceable\"><code>dbname</code></em> can also be a <a class=\"link\" href=\"/docs/17/libpq-connect.html#LIBPQ-CONNSTRING\" title=\"32.1.1.\u00a0Connection Strings\">connection string</a>.</p>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.4.9.6\">\n<h2>Options</h2>\n<p>The following command-line options control what is checked:</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-a</code><br></span><span class=\"term\"><code class=\"option\">--all</code></span></dt>\n<dd>\n<p>Check all databases, except for any excluded via <code class=\"option\">--exclude-database</code>.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-d <em class=\"replaceable\"><code>pattern</code></em></code><br></span><span class=\"term\"><code class=\"option\">--database=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p>Check databases matching the specified <a class=\"link\" href=\"/docs/17/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"><em class=\"replaceable\"><code>pattern</code></em></a>, except for any excluded by <code class=\"option\">--exclude-database</code>. This option can be specified more than once.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-D <em class=\"replaceable\"><code>pattern</code></em></code><br></span><span class=\"term\"><code class=\"option\">--exclude-database=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p>Exclude databases matching the given <a class=\"link\" href=\"/docs/17/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"><em class=\"replaceable\"><code>pattern</code></em></a>. This option can be specified more than once.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-i <em class=\"replaceable\"><code>pattern</code></em></code><br></span><span class=\"term\"><code class=\"option\">--index=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p>Check indexes matching the specified <a class=\"link\" href=\"/docs/17/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"><em class=\"replaceable\"><code>pattern</code></em></a>, unless they are otherwise excluded. This option can be specified more than once.</p>\n<p>This is similar to the <code class=\"option\">--relation</code> option, except that it applies only to indexes, not to other relation types.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-I <em class=\"replaceable\"><code>pattern</code></em></code><br></span><span class=\"term\"><code class=\"option\">--exclude-index=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p>Exclude indexes matching the specified <a class=\"link\" href=\"/docs/17/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"><em class=\"replaceable\"><code>pattern</code></em></a>. This option can be specified more than once.</p>\n<p>This is similar to the <code class=\"option\">--exclude-relation</code> option, except that it applies only to indexes, not other relation types.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-r <em class=\"replaceable\"><code>pattern</code></em></code><br></span><span class=\"term\"><code class=\"option\">--relation=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p>Check relations matching the specified <a class=\"link\" href=\"/docs/17/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"><em class=\"replaceable\"><code>pattern</code></em></a>, unless they are otherwise excluded. This option can be specified more than once.</p>\n<p>Patterns may be unqualified, e.g. <code class=\"literal\">myrel*</code>, or they may be schema-qualified, e.g. <code class=\"literal\">myschema*.myrel*</code> or database-qualified and schema-qualified, e.g. <code class=\"literal\">mydb*.myschema*.myrel*</code>. A database-qualified pattern will add matching databases to the list of databases to be checked.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-R <em class=\"replaceable\"><code>pattern</code></em></code><br></span><span class=\"term\"><code class=\"option\">--exclude-relation=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p>Exclude relations matching the specified <a class=\"link\" href=\"/docs/17/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"><em class=\"replaceable\"><code>pattern</code></em></a>. This option can be specified more than once.</p>\n<p>As with <code class=\"option\">--relation</code>, the <a class=\"link\" href=\"/docs/17/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"><em class=\"replaceable\"><code>pattern</code></em></a> may be unqualified, schema-qualified, or database- and schema-qualified.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-s <em class=\"replaceable\"><code>pattern</code></em></code><br></span><span class=\"term\"><code class=\"option\">--schema=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p>Check tables and indexes in schemas matching the specified <a class=\"link\" href=\"/docs/17/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"><em class=\"replaceable\"><code>pattern</code></em></a>, unless they are otherwise excluded. This option can be specified more than once.</p>\n<p>To select only tables in schemas matching a particular pattern, consider using something like <code class=\"literal\">--table=SCHEMAPAT.* --no-dependent-indexes</code>. To select only indexes, consider using something like <code class=\"literal\">--index=SCHEMAPAT.*</code>.</p>\n<p>A schema pattern may be database-qualified. For example, you may write <code class=\"literal\">--schema=mydb*.myschema*</code> to select schemas matching <code class=\"literal\">myschema*</code> in databases matching <code class=\"literal\">mydb*</code>.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-S <em class=\"replaceable\"><code>pattern</code></em></code><br></span><span class=\"term\"><code class=\"option\">--exclude-schema=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p>Exclude tables and indexes in schemas matching the specified <a class=\"link\" href=\"/docs/17/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"><em class=\"replaceable\"><code>pattern</code></em></a>. This option can be specified more than once.</p>\n<p>As with <code class=\"option\">--schema</code>, the pattern may be database-qualified.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-t <em class=\"replaceable\"><code>pattern</code></em></code><br></span><span class=\"term\"><code class=\"option\">--table=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p>Check tables matching the specified <a class=\"link\" href=\"/docs/17/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"><em class=\"replaceable\"><code>pattern</code></em></a>, unless they are otherwise excluded. This option can be specified more than once.</p>\n<p>This is similar to the <code class=\"option\">--relation</code> option, except that it applies only to tables, materialized views, and sequences, not to indexes.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-T <em class=\"replaceable\"><code>pattern</code></em></code><br></span><span class=\"term\"><code class=\"option\">--exclude-table=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p>Exclude tables matching the specified <a class=\"link\" href=\"/docs/17/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"><em class=\"replaceable\"><code>pattern</code></em></a>. This option can be specified more than once.</p>\n<p>This is similar to the <code class=\"option\">--exclude-relation</code> option, except that it applies only to tables, materialized views, and sequences, not to indexes.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-dependent-indexes</code></span></dt>\n<dd>\n<p>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 <code class=\"literal\">--index</code> or <code class=\"literal\">--relation</code>. This option suppresses that behavior.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-dependent-toast</code></span></dt>\n<dd>\n<p>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 <code class=\"literal\">--table</code> or <code class=\"literal\">--relation</code>. This option suppresses that behavior.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-strict-names</code></span></dt>\n<dd>\n<p>By default, if an argument to <code class=\"literal\">--database</code>, <code class=\"literal\">--table</code>, <code class=\"literal\">--index</code>, or <code class=\"literal\">--relation</code> matches no objects, it is a fatal error. This option downgrades that error to a warning.</p>\n</dd>\n</dl>\n</div>\n<p>The following command-line options control checking of tables:</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">--exclude-toast-pointers</code></span></dt>\n<dd>\n<p>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.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--on-error-stop</code></span></dt>\n<dd>\n<p>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.</p>\n<p>Note that index checking always stops after the first corrupt page. This option only has meaning relative to table relations.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--skip=<em class=\"replaceable\"><code>option</code></em></code></span></dt>\n<dd>\n<p>If <code class=\"literal\">all-frozen</code> is given, table corruption checks will skip over pages in all tables that are marked as all frozen.</p>\n<p>If <code class=\"literal\">all-visible</code> is given, table corruption checks will skip over pages in all tables that are marked as all visible.</p>\n<p>By default, no pages are skipped. This can be specified as <code class=\"literal\">none</code>, but since this is the default, it need not be mentioned.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--startblock=<em class=\"replaceable\"><code>block</code></em></code></span></dt>\n<dd>\n<p>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 <code class=\"literal\">--endblock</code> for further caveats.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--endblock=<em class=\"replaceable\"><code>block</code></em></code></span></dt>\n<dd>\n<p>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 <code class=\"option\">--exclude-toast-pointers</code>.</p>\n</dd>\n</dl>\n</div>\n<p>The following command-line options control checking of B-tree indexes:</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">--checkunique</code></span></dt>\n<dd>\n<p>For each index with unique constraint checked, verify that no more than one among duplicate entries is visible in the index using <a class=\"xref\" href=\"/docs/17/amcheck.html\" title=\"F.1.\u00a0amcheck \u2014 tools to verify table and index consistency\">amcheck</a>'s <code class=\"option\">checkunique</code> option.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--heapallindexed</code></span></dt>\n<dd>\n<p>For each index checked, verify the presence of all heap tuples as index tuples in the index using <a class=\"xref\" href=\"/docs/17/amcheck.html\" title=\"F.1.\u00a0amcheck \u2014 tools to verify table and index consistency\">amcheck</a>'s <code class=\"option\">heapallindexed</code> option.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--parent-check</code></span></dt>\n<dd>\n<p>For each btree index checked, use <a class=\"xref\" href=\"/docs/17/amcheck.html\" title=\"F.1.\u00a0amcheck \u2014 tools to verify table and index consistency\">amcheck</a>'s <code class=\"function\">bt_index_parent_check</code> function, which performs additional checks of parent/child relationships during index checking.</p>\n<p>The default is to use <span class=\"application\">amcheck</span>'s <code class=\"function\">bt_index_check</code> function, but note that use of the <code class=\"option\">--rootdescend</code> option implicitly selects <code class=\"function\">bt_index_parent_check</code>.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--rootdescend</code></span></dt>\n<dd>\n<p>For each index checked, re-find tuples on the leaf level by performing a new search from the root page for each tuple using <a class=\"xref\" href=\"/docs/17/amcheck.html\" title=\"F.1.\u00a0amcheck \u2014 tools to verify table and index consistency\">amcheck</a>'s <code class=\"option\">rootdescend</code> option.</p>\n<p>Use of this option implicitly also selects the <code class=\"option\">--parent-check</code> option.</p>\n<p>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.</p>\n</dd>\n</dl>\n</div>\n<div class=\"warning\">\n<h3 class=\"title\">Warning</h3>\n<p>The extra checks performed against B-tree indexes when the <code class=\"option\">--parent-check</code> option or the <code class=\"option\">--rootdescend</code> option is specified require relatively strong relation-level locks. These checks are the only checks that will block concurrent data modification from <code class=\"command\">INSERT</code>, <code class=\"command\">UPDATE</code>, and <code class=\"command\">DELETE</code> commands.</p>\n</div>\n<p>The following command-line options control the connection to the server:</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-h <em class=\"replaceable\"><code>hostname</code></em></code><br></span><span class=\"term\"><code class=\"option\">--host=<em class=\"replaceable\"><code>hostname</code></em></code></span></dt>\n<dd>\n<p>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.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-p <em class=\"replaceable\"><code>port</code></em></code><br></span><span class=\"term\"><code class=\"option\">--port=<em class=\"replaceable\"><code>port</code></em></code></span></dt>\n<dd>\n<p>Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-U</code><br></span><span class=\"term\"><code class=\"option\">--username=<em class=\"replaceable\"><code>username</code></em></code></span></dt>\n<dd>\n<p>User name to connect as.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-w</code><br></span><span class=\"term\"><code class=\"option\">--no-password</code></span></dt>\n<dd>\n<p>Never issue a password prompt. If the server requires password authentication and a password is not available by other means such as a <code class=\"filename\">.pgpass</code> 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.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-W</code><br></span><span class=\"term\"><code class=\"option\">--password</code></span></dt>\n<dd>\n<p>Force <span class=\"application\">pg_amcheck</span> to prompt for a password before connecting to a database.</p>\n<p>This option is never essential, since <span class=\"application\">pg_amcheck</span> will automatically prompt for a password if the server demands password authentication. However, <span class=\"application\">pg_amcheck</span> will waste a connection attempt finding out that the server wants a password. In some cases it is worth typing <code class=\"option\">-W</code> to avoid the extra connection attempt.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--maintenance-db=<em class=\"replaceable\"><code>dbname</code></em></code></span></dt>\n<dd>\n<p>Specifies a database or <a class=\"link\" href=\"/docs/17/libpq-connect.html#LIBPQ-CONNSTRING\" title=\"32.1.1.\u00a0Connection Strings\">connection string</a> to be used to discover the list of databases to be checked. If neither <code class=\"option\">--all</code> 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 <code class=\"literal\">postgres</code> or, if that fails, <code class=\"literal\">template1</code>.</p>\n</dd>\n</dl>\n</div>\n<p>Other options are also available:</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-e</code><br></span><span class=\"term\"><code class=\"option\">--echo</code></span></dt>\n<dd>\n<p>Echo to stdout all SQL sent to the server.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-j <em class=\"replaceable\"><code>num</code></em></code><br></span><span class=\"term\"><code class=\"option\">--jobs=<em class=\"replaceable\"><code>num</code></em></code></span></dt>\n<dd>\n<p>Use <em class=\"replaceable\"><code>num</code></em> concurrent connections to the server, or one per object to be checked, whichever is less.</p>\n<p>The default is to use a single connection.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-P</code><br></span><span class=\"term\"><code class=\"option\">--progress</code></span></dt>\n<dd>\n<p>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.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-v</code><br></span><span class=\"term\"><code class=\"option\">--verbose</code></span></dt>\n<dd>\n<p>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.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-V</code><br></span><span class=\"term\"><code class=\"option\">--version</code></span></dt>\n<dd>\n<p>Print the <span class=\"application\">pg_amcheck</span> version and exit.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--install-missing</code><br></span><span class=\"term\"><code class=\"option\">--install-missing=<em class=\"replaceable\"><code>schema</code></em></code></span></dt>\n<dd>\n<p>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 <em class=\"replaceable\"><code>schema</code></em>, or if not specified into schema <code class=\"literal\">pg_catalog</code>.</p>\n<p>At present, the only required extension is <a class=\"xref\" href=\"/docs/17/amcheck.html\" title=\"F.1.\u00a0amcheck \u2014 tools to verify table and index consistency\">amcheck</a>.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-?</code><br></span><span class=\"term\"><code class=\"option\">--help</code></span></dt>\n<dd>\n<p>Show help about <span class=\"application\">pg_amcheck</span> command line arguments, and exit.</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.4.9.7\">\n<h2>Environment</h2>\n<p><code class=\"command\">pg_amcheck</code>, like most other <span class=\"productname\">PostgreSQL</span> utilities, also uses the environment variables supported by <span class=\"application\">libpq</span> (see <a class=\"xref\" href=\"/docs/17/libpq-envars.html\" title=\"32.15.\u00a0Environment Variables\">Section\u00a032.15</a>).</p>\n<p>The environment variable <code class=\"envar\">PG_COLOR</code> specifies whether to use color in diagnostic messages. Possible values are <code class=\"literal\">always</code>, <code class=\"literal\">auto</code> and <code class=\"literal\">never</code>.</p>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.4.9.8\">\n<h2>Notes</h2>\n<p><span class=\"application\">pg_amcheck</span> is designed to work with <span class=\"productname\">PostgreSQL</span> 14.0 and later.</p>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.4.9.9\">\n<h2>See Also</h2><span class=\"simplelist\"><a class=\"xref\" href=\"/docs/17/amcheck.html\" title=\"F.1.\u00a0amcheck \u2014 tools to verify table and index consistency\">amcheck</a></span>\n</div>\n</div></div>", "manual_path": "app-pgamcheck.html", "comparison_data": {"options": [{"names": ["-a", "--all"], "signature": "-a --all", "description": "Check all databases, except for any excluded via --exclude-database ."}, {"names": ["-d pattern", "--database= pattern"], "signature": "-d pattern --database= pattern", "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", "--exclude-database= pattern"], "signature": "-D pattern --exclude-database= pattern", "description": "Exclude databases matching the given pattern . This option can be specified more than once."}, {"names": ["-i pattern", "--index= pattern"], "signature": "-i pattern --index= 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", "--exclude-index= pattern"], "signature": "-I pattern --exclude-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": ["-r pattern", "--relation= pattern"], "signature": "-r pattern --relation= 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", "--exclude-relation= pattern"], "signature": "-R pattern --exclude-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": ["-s pattern", "--schema= pattern"], "signature": "-s pattern --schema= 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", "--exclude-schema= pattern"], "signature": "-S pattern --exclude-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": ["-t pattern", "--table= pattern"], "signature": "-t pattern --table= 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", "--exclude-table= pattern"], "signature": "-T pattern --exclude-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": ["--no-dependent-indexes"], "signature": "--no-dependent-indexes", "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-toast"], "signature": "--no-dependent-toast", "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-strict-names"], "signature": "--no-strict-names", "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": ["--exclude-toast-pointers"], "signature": "--exclude-toast-pointers", "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": ["--on-error-stop"], "signature": "--on-error-stop", "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": ["--skip= option"], "signature": "--skip= option", "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": ["--startblock= block"], "signature": "--startblock= block", "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": ["--endblock= block"], "signature": "--endblock= 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": ["--checkunique"], "signature": "--checkunique", "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": ["--heapallindexed"], "signature": "--heapallindexed", "description": "For each index checked, verify the presence of all heap tuples as index tuples in the index using amcheck 's heapallindexed option."}, {"names": ["--parent-check"], "signature": "--parent-check", "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": ["--rootdescend"], "signature": "--rootdescend", "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": ["-h hostname", "--host= hostname"], "signature": "-h hostname --host= hostname", "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": ["-p port", "--port= port"], "signature": "-p port --port= port", "description": "Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections."}, {"names": ["-U", "--username= username"], "signature": "-U --username= username", "description": "User name to connect as."}, {"names": ["-w", "--no-password"], "signature": "-w --no-password", "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", "--password"], "signature": "-W --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": ["--maintenance-db= dbname"], "signature": "--maintenance-db= dbname", "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": ["-e", "--echo"], "signature": "-e --echo", "description": "Echo to stdout all SQL sent to the server."}, {"names": ["-j num", "--jobs= num"], "signature": "-j num --jobs= num", "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": ["-P", "--progress"], "signature": "-P --progress", "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": ["-v", "--verbose"], "signature": "-v --verbose", "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", "--version"], "signature": "-V --version", "description": "Print the pg_amcheck version and exit."}, {"names": ["--install-missing", "--install-missing= schema"], "signature": "--install-missing --install-missing= schema", "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": ["-?", "--help"], "signature": "-? --help", "description": "Show help about pg_amcheck command line arguments, and exit."}], "synopsis": ["pg_amcheck [ option ...] [ dbname ]"], "environment": []}, "comparison_hash": "e007a3ce54383d588583bd426bfaa62aba42504ba26ff80ad24c0c65d13af539"}, "18": {"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"}], "tables": [{"key": "options", "rows": [{"summary": "Check all databases, except for any excluded via --exclude-database .", "signature": {"url": "/docs/18/app-pgamcheck.html", "text": "-a --all"}}, {"summary": "Check databases matching the specified pattern , except for any excluded by --exclude-database . This option can be specified more than once.", "signature": {"url": "/docs/18/app-pgamcheck.html", "text": "-d pattern --database= pattern"}}, {"summary": "Exclude databases matching the given pattern . This option can be specified more than once.", "signature": {"url": "/docs/18/app-pgamcheck.html", "text": "-D pattern --exclude-database= pattern"}}, {"summary": "Check indexes matching the specified pattern , unless they are otherwise excluded. This option can be specified more than once.", "signature": {"url": "/docs/18/app-pgamcheck.html", "text": "-i pattern --index= pattern"}}, {"summary": "Exclude indexes matching the specified pattern . This option can be specified more than once.", "signature": {"url": "/docs/18/app-pgamcheck.html", "text": "-I pattern --exclude-index= pattern"}}, {"summary": "Check relations matching the specified pattern , unless they are otherwise excluded. This option can be specified more than once.", "signature": {"url": "/docs/18/app-pgamcheck.html", "text": "-r pattern --relation= pattern"}}, {"summary": "Exclude relations matching the specified pattern . This option can be specified more than once.", "signature": {"url": "/docs/18/app-pgamcheck.html", "text": "-R pattern --exclude-relation= pattern"}}, {"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": {"url": "/docs/18/app-pgamcheck.html", "text": "-s pattern --schema= pattern"}}, {"summary": "Exclude tables and indexes in schemas matching the specified pattern . This option can be specified more than once.", "signature": {"url": "/docs/18/app-pgamcheck.html", "text": "-S pattern --exclude-schema= pattern"}}, {"summary": "Check tables matching the specified pattern , unless they are otherwise excluded. This option can be specified more than once.", "signature": {"url": "/docs/18/app-pgamcheck.html", "text": "-t pattern --table= pattern"}}, {"summary": "Exclude tables matching the specified pattern . This option can be specified more than once.", "signature": {"url": "/docs/18/app-pgamcheck.html", "text": "-T pattern --exclude-table= pattern"}}, {"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": {"url": "/docs/18/app-pgamcheck.html", "text": "--no-dependent-indexes"}}, {"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": {"url": "/docs/18/app-pgamcheck.html", "text": "--no-dependent-toast"}}, {"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": {"url": "/docs/18/app-pgamcheck.html", "text": "--no-strict-names"}}, {"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": {"url": "/docs/18/app-pgamcheck.html", "text": "--exclude-toast-pointers"}}, {"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": {"url": "/docs/18/app-pgamcheck.html", "text": "--on-error-stop"}}, {"summary": "If all-frozen is given, table corruption checks will skip over pages in all tables that are marked as all frozen.", "signature": {"url": "/docs/18/app-pgamcheck.html", "text": "--skip= option"}}, {"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": {"url": "/docs/18/app-pgamcheck.html", "text": "--startblock= block"}}, {"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": {"url": "/docs/18/app-pgamcheck.html", "text": "--endblock= block"}}, {"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": {"url": "/docs/18/app-pgamcheck.html", "text": "--checkunique"}}, {"summary": "For each index checked, verify the presence of all heap tuples as index tuples in the index using amcheck 's heapallindexed option.", "signature": {"url": "/docs/18/app-pgamcheck.html", "text": "--heapallindexed"}}, {"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": {"url": "/docs/18/app-pgamcheck.html", "text": "--parent-check"}}, {"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": {"url": "/docs/18/app-pgamcheck.html", "text": "--rootdescend"}}, {"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": {"url": "/docs/18/app-pgamcheck.html", "text": "-h hostname --host= hostname"}}, {"summary": "Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections.", "signature": {"url": "/docs/18/app-pgamcheck.html", "text": "-p port --port= port"}}, {"summary": "User name to connect as.", "signature": {"url": "/docs/18/app-pgamcheck.html", "text": "-U --username= username"}}, {"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": {"url": "/docs/18/app-pgamcheck.html", "text": "-w --no-password"}}, {"summary": "Force pg_amcheck to prompt for a password before connecting to a database.", "signature": {"url": "/docs/18/app-pgamcheck.html", "text": "-W --password"}}, {"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": {"url": "/docs/18/app-pgamcheck.html", "text": "--maintenance-db= dbname"}}, {"summary": "Echo to stdout all SQL sent to the server.", "signature": {"url": "/docs/18/app-pgamcheck.html", "text": "-e --echo"}}, {"summary": "Use num concurrent connections to the server, or one per object to be checked, whichever is less.", "signature": {"url": "/docs/18/app-pgamcheck.html", "text": "-j num --jobs= num"}}, {"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": {"url": "/docs/18/app-pgamcheck.html", "text": "-P --progress"}}, {"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": {"url": "/docs/18/app-pgamcheck.html", "text": "-v --verbose"}}, {"summary": "Print the pg_amcheck version and exit.", "signature": {"url": "/docs/18/app-pgamcheck.html", "text": "-V --version"}}, {"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": {"url": "/docs/18/app-pgamcheck.html", "text": "--install-missing --install-missing= schema"}}, {"summary": "Show help about pg_amcheck command line arguments, and exit.", "signature": {"url": "/docs/18/app-pgamcheck.html", "text": "-? --help"}}], "title": "Documented options", "columns": [{"key": "signature", "label": "Option and arguments"}, {"key": "summary", "label": "Description"}]}], "options": [{"names": ["-a", "--all"], "summary": "Check all databases, except for any excluded via --exclude-database .", "signature": "-a --all", "source_url": "/docs/18/app-pgamcheck.html", "description": "Check all databases, except for any excluded via --exclude-database ."}, {"names": ["-d pattern", "--database= pattern"], "summary": "Check databases matching the specified pattern , except for any excluded by --exclude-database . This option can be specified more than once.", "signature": "-d pattern --database= pattern", "source_url": "/docs/18/app-pgamcheck.html", "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", "--exclude-database= pattern"], "summary": "Exclude databases matching the given pattern . This option can be specified more than once.", "signature": "-D pattern --exclude-database= pattern", "source_url": "/docs/18/app-pgamcheck.html", "description": "Exclude databases matching the given pattern . This option can be specified more than once."}, {"names": ["-i pattern", "--index= pattern"], "summary": "Check indexes matching the specified pattern , unless they are otherwise excluded. This option can be specified more than once.", "signature": "-i pattern --index= pattern", "source_url": "/docs/18/app-pgamcheck.html", "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", "--exclude-index= pattern"], "summary": "Exclude indexes matching the specified pattern . This option can be specified more than once.", "signature": "-I pattern --exclude-index= pattern", "source_url": "/docs/18/app-pgamcheck.html", "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": ["-r pattern", "--relation= pattern"], "summary": "Check relations matching the specified pattern , unless they are otherwise excluded. This option can be specified more than once.", "signature": "-r pattern --relation= pattern", "source_url": "/docs/18/app-pgamcheck.html", "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", "--exclude-relation= pattern"], "summary": "Exclude relations matching the specified pattern . This option can be specified more than once.", "signature": "-R pattern --exclude-relation= pattern", "source_url": "/docs/18/app-pgamcheck.html", "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": ["-s pattern", "--schema= pattern"], "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": "-s pattern --schema= pattern", "source_url": "/docs/18/app-pgamcheck.html", "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", "--exclude-schema= pattern"], "summary": "Exclude tables and indexes in schemas matching the specified pattern . This option can be specified more than once.", "signature": "-S pattern --exclude-schema= pattern", "source_url": "/docs/18/app-pgamcheck.html", "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": ["-t pattern", "--table= pattern"], "summary": "Check tables matching the specified pattern , unless they are otherwise excluded. This option can be specified more than once.", "signature": "-t pattern --table= pattern", "source_url": "/docs/18/app-pgamcheck.html", "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", "--exclude-table= pattern"], "summary": "Exclude tables matching the specified pattern . This option can be specified more than once.", "signature": "-T pattern --exclude-table= pattern", "source_url": "/docs/18/app-pgamcheck.html", "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": ["--no-dependent-indexes"], "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": "--no-dependent-indexes", "source_url": "/docs/18/app-pgamcheck.html", "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-toast"], "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": "--no-dependent-toast", "source_url": "/docs/18/app-pgamcheck.html", "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-strict-names"], "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": "--no-strict-names", "source_url": "/docs/18/app-pgamcheck.html", "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": ["--exclude-toast-pointers"], "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": "--exclude-toast-pointers", "source_url": "/docs/18/app-pgamcheck.html", "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": ["--on-error-stop"], "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": "--on-error-stop", "source_url": "/docs/18/app-pgamcheck.html", "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": ["--skip= option"], "summary": "If all-frozen is given, table corruption checks will skip over pages in all tables that are marked as all frozen.", "signature": "--skip= option", "source_url": "/docs/18/app-pgamcheck.html", "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": ["--startblock= block"], "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": "--startblock= block", "source_url": "/docs/18/app-pgamcheck.html", "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": ["--endblock= block"], "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": "--endblock= block", "source_url": "/docs/18/app-pgamcheck.html", "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": ["--checkunique"], "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": "--checkunique", "source_url": "/docs/18/app-pgamcheck.html", "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": ["--heapallindexed"], "summary": "For each index checked, verify the presence of all heap tuples as index tuples in the index using amcheck 's heapallindexed option.", "signature": "--heapallindexed", "source_url": "/docs/18/app-pgamcheck.html", "description": "For each index checked, verify the presence of all heap tuples as index tuples in the index using amcheck 's heapallindexed option."}, {"names": ["--parent-check"], "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": "--parent-check", "source_url": "/docs/18/app-pgamcheck.html", "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": ["--rootdescend"], "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": "--rootdescend", "source_url": "/docs/18/app-pgamcheck.html", "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": ["-h hostname", "--host= hostname"], "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": "-h hostname --host= hostname", "source_url": "/docs/18/app-pgamcheck.html", "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": ["-p port", "--port= port"], "summary": "Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections.", "signature": "-p port --port= port", "source_url": "/docs/18/app-pgamcheck.html", "description": "Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections."}, {"names": ["-U", "--username= username"], "summary": "User name to connect as.", "signature": "-U --username= username", "source_url": "/docs/18/app-pgamcheck.html", "description": "User name to connect as."}, {"names": ["-w", "--no-password"], "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": "-w --no-password", "source_url": "/docs/18/app-pgamcheck.html", "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", "--password"], "summary": "Force pg_amcheck to prompt for a password before connecting to a database.", "signature": "-W --password", "source_url": "/docs/18/app-pgamcheck.html", "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": ["--maintenance-db= dbname"], "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": "--maintenance-db= dbname", "source_url": "/docs/18/app-pgamcheck.html", "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": ["-e", "--echo"], "summary": "Echo to stdout all SQL sent to the server.", "signature": "-e --echo", "source_url": "/docs/18/app-pgamcheck.html", "description": "Echo to stdout all SQL sent to the server."}, {"names": ["-j num", "--jobs= num"], "summary": "Use num concurrent connections to the server, or one per object to be checked, whichever is less.", "signature": "-j num --jobs= num", "source_url": "/docs/18/app-pgamcheck.html", "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": ["-P", "--progress"], "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": "-P --progress", "source_url": "/docs/18/app-pgamcheck.html", "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": ["-v", "--verbose"], "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": "-v --verbose", "source_url": "/docs/18/app-pgamcheck.html", "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", "--version"], "summary": "Print the pg_amcheck version and exit.", "signature": "-V --version", "source_url": "/docs/18/app-pgamcheck.html", "description": "Print the pg_amcheck version and exit."}, {"names": ["--install-missing", "--install-missing= schema"], "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": "--install-missing --install-missing= schema", "source_url": "/docs/18/app-pgamcheck.html", "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": ["-?", "--help"], "summary": "Show help about pg_amcheck command line arguments, and exit.", "signature": "-? --help", "source_url": "/docs/18/app-pgamcheck.html", "description": "Show help about pg_amcheck command line arguments, and exit."}], "related": [], "release": {"ref": "https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2", "label": "18.6", "major": "18", "channel": "stable", "manifest": {"pdf": {"A4": {"url": "/files/documentation/pdf/18/postgresql-18-A4.pdf", "bytes": 15865106, "pages": 3154, "sha256": "19512c405da53f9f7fcf0abba359223aa65f021be025bf3411381918f92e3190", "built_at": "2026-09-26"}, "US": {"url": "/files/documentation/pdf/18/postgresql-18-US.pdf", "bytes": 15748059, "pages": 3328, "sha256": "facbe6c229e598b872d3d98bef53308f46e06746006fa4590de9a7de9dd46319", "built_at": "2026-09-26"}}, "tree": "18", "index": "index.html", "major": "18", "pages": 1148, "release": "18.6", "source_url": "https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2", "svg_assets": 3, "source_mode": "en SGML built with pinned official archive", "source_sha256": "555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f"}, "revision": "ee8d1a3612338fd9adf250730cb640fcc5233b5491337cc00a316a44e3a0b9f8", "evidence_kind": "English manual and source declarations", "source_sha256": "555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f"}, "sources": [{"url": "/docs/18/app-pgamcheck.html", "file": "app-pgamcheck.html", "label": "18.6 English manual \u00b7 app-pgamcheck.html", "anchor": "", "sha256": "e27a4203de24586f422047021fddd4cd69bbe0093c3949ac283091329050c9f5"}, {"url": "/docs/18/reference-client.html", "file": "reference-client.html", "label": "Client applications inventory", "anchor": "", "sha256": "68f726af77272fe73a827be2b7b5958d0f2239a6f8ed44264e9d42496bfa4fd0"}], "sections": [], "synopsis": ["pg_amcheck [ option ...] [ dbname ]"], "signature": "pg_amcheck [ option ...] [ dbname ]", "description": ["pg_amcheck \u2014 checks for corruption in one or more PostgreSQL databases"], "environment": [], "manual_html": "<div><div class=\"refentry\" id=\"APP-PGAMCHECK\">\n<div class=\"titlepage\"></div>\n<div class=\"refnamediv\">\n<h2><span class=\"refentrytitle\"><span class=\"application\">pg_amcheck</span></span></h2>\n<p>pg_amcheck \u2014 checks for corruption in one or more <span class=\"productname\">PostgreSQL</span> databases</p>\n</div>\n<div class=\"refsynopsisdiv\">\n<h2>Synopsis</h2>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.4.9.4.1\"><code class=\"command\">pg_amcheck</code> [<em class=\"replaceable\"><code>option</code></em>...] [<em class=\"replaceable\"><code>dbname</code></em>]</p>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.4.9.5\">\n<h2>Description</h2>\n<p><span class=\"application\">pg_amcheck</span> supports running <a class=\"xref\" href=\"/docs/18/amcheck.html\" title=\"F.1.\u00a0amcheck \u2014 tools to verify table and index consistency\">amcheck</a>'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.</p>\n<p>Only ordinary and toast table relations, materialized views, sequences, and btree indexes are currently supported. Other relation types are silently skipped.</p>\n<p>If <code class=\"literal\">dbname</code> 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 <code class=\"option\">--all</code>, <code class=\"option\">--database</code> and <code class=\"option\">--exclude-database</code>. They also include <code class=\"option\">--relation</code>, <code class=\"option\">--exclude-relation</code>, <code class=\"option\">--table</code>, <code class=\"option\">--exclude-table</code>, <code class=\"option\">--index</code>, and <code class=\"option\">--exclude-index</code>, but only when such options are used with a three-part pattern (e.g. <code class=\"option\">mydb*.myschema*.myrel*</code>). Finally, they include <code class=\"option\">--schema</code> and <code class=\"option\">--exclude-schema</code> when such options are used with a two-part pattern (e.g. <code class=\"option\">mydb*.myschema*</code>).</p>\n<p><em class=\"replaceable\"><code>dbname</code></em> can also be a <a class=\"link\" href=\"/docs/18/libpq-connect.html#LIBPQ-CONNSTRING\" title=\"32.1.1.\u00a0Connection Strings\">connection string</a>.</p>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.4.9.6\">\n<h2>Options</h2>\n<p>The following command-line options control what is checked:</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-a</code><br></span><span class=\"term\"><code class=\"option\">--all</code></span></dt>\n<dd>\n<p>Check all databases, except for any excluded via <code class=\"option\">--exclude-database</code>.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-d <em class=\"replaceable\"><code>pattern</code></em></code><br></span><span class=\"term\"><code class=\"option\">--database=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p>Check databases matching the specified <a class=\"link\" href=\"/docs/18/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"><em class=\"replaceable\"><code>pattern</code></em></a>, except for any excluded by <code class=\"option\">--exclude-database</code>. This option can be specified more than once.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-D <em class=\"replaceable\"><code>pattern</code></em></code><br></span><span class=\"term\"><code class=\"option\">--exclude-database=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p>Exclude databases matching the given <a class=\"link\" href=\"/docs/18/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"><em class=\"replaceable\"><code>pattern</code></em></a>. This option can be specified more than once.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-i <em class=\"replaceable\"><code>pattern</code></em></code><br></span><span class=\"term\"><code class=\"option\">--index=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p>Check indexes matching the specified <a class=\"link\" href=\"/docs/18/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"><em class=\"replaceable\"><code>pattern</code></em></a>, unless they are otherwise excluded. This option can be specified more than once.</p>\n<p>This is similar to the <code class=\"option\">--relation</code> option, except that it applies only to indexes, not to other relation types.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-I <em class=\"replaceable\"><code>pattern</code></em></code><br></span><span class=\"term\"><code class=\"option\">--exclude-index=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p>Exclude indexes matching the specified <a class=\"link\" href=\"/docs/18/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"><em class=\"replaceable\"><code>pattern</code></em></a>. This option can be specified more than once.</p>\n<p>This is similar to the <code class=\"option\">--exclude-relation</code> option, except that it applies only to indexes, not other relation types.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-r <em class=\"replaceable\"><code>pattern</code></em></code><br></span><span class=\"term\"><code class=\"option\">--relation=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p>Check relations matching the specified <a class=\"link\" href=\"/docs/18/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"><em class=\"replaceable\"><code>pattern</code></em></a>, unless they are otherwise excluded. This option can be specified more than once.</p>\n<p>Patterns may be unqualified, e.g. <code class=\"literal\">myrel*</code>, or they may be schema-qualified, e.g. <code class=\"literal\">myschema*.myrel*</code> or database-qualified and schema-qualified, e.g. <code class=\"literal\">mydb*.myschema*.myrel*</code>. A database-qualified pattern will add matching databases to the list of databases to be checked.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-R <em class=\"replaceable\"><code>pattern</code></em></code><br></span><span class=\"term\"><code class=\"option\">--exclude-relation=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p>Exclude relations matching the specified <a class=\"link\" href=\"/docs/18/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"><em class=\"replaceable\"><code>pattern</code></em></a>. This option can be specified more than once.</p>\n<p>As with <code class=\"option\">--relation</code>, the <a class=\"link\" href=\"/docs/18/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"><em class=\"replaceable\"><code>pattern</code></em></a> may be unqualified, schema-qualified, or database- and schema-qualified.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-s <em class=\"replaceable\"><code>pattern</code></em></code><br></span><span class=\"term\"><code class=\"option\">--schema=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p>Check tables and indexes in schemas matching the specified <a class=\"link\" href=\"/docs/18/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"><em class=\"replaceable\"><code>pattern</code></em></a>, unless they are otherwise excluded. This option can be specified more than once.</p>\n<p>To select only tables in schemas matching a particular pattern, consider using something like <code class=\"literal\">--table=SCHEMAPAT.* --no-dependent-indexes</code>. To select only indexes, consider using something like <code class=\"literal\">--index=SCHEMAPAT.*</code>.</p>\n<p>A schema pattern may be database-qualified. For example, you may write <code class=\"literal\">--schema=mydb*.myschema*</code> to select schemas matching <code class=\"literal\">myschema*</code> in databases matching <code class=\"literal\">mydb*</code>.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-S <em class=\"replaceable\"><code>pattern</code></em></code><br></span><span class=\"term\"><code class=\"option\">--exclude-schema=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p>Exclude tables and indexes in schemas matching the specified <a class=\"link\" href=\"/docs/18/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"><em class=\"replaceable\"><code>pattern</code></em></a>. This option can be specified more than once.</p>\n<p>As with <code class=\"option\">--schema</code>, the pattern may be database-qualified.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-t <em class=\"replaceable\"><code>pattern</code></em></code><br></span><span class=\"term\"><code class=\"option\">--table=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p>Check tables matching the specified <a class=\"link\" href=\"/docs/18/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"><em class=\"replaceable\"><code>pattern</code></em></a>, unless they are otherwise excluded. This option can be specified more than once.</p>\n<p>This is similar to the <code class=\"option\">--relation</code> option, except that it applies only to tables, materialized views, and sequences, not to indexes.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-T <em class=\"replaceable\"><code>pattern</code></em></code><br></span><span class=\"term\"><code class=\"option\">--exclude-table=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p>Exclude tables matching the specified <a class=\"link\" href=\"/docs/18/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"><em class=\"replaceable\"><code>pattern</code></em></a>. This option can be specified more than once.</p>\n<p>This is similar to the <code class=\"option\">--exclude-relation</code> option, except that it applies only to tables, materialized views, and sequences, not to indexes.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-dependent-indexes</code></span></dt>\n<dd>\n<p>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 <code class=\"literal\">--index</code> or <code class=\"literal\">--relation</code>. This option suppresses that behavior.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-dependent-toast</code></span></dt>\n<dd>\n<p>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 <code class=\"literal\">--table</code> or <code class=\"literal\">--relation</code>. This option suppresses that behavior.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-strict-names</code></span></dt>\n<dd>\n<p>By default, if an argument to <code class=\"literal\">--database</code>, <code class=\"literal\">--table</code>, <code class=\"literal\">--index</code>, or <code class=\"literal\">--relation</code> matches no objects, it is a fatal error. This option downgrades that error to a warning.</p>\n</dd>\n</dl>\n</div>\n<p>The following command-line options control checking of tables:</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">--exclude-toast-pointers</code></span></dt>\n<dd>\n<p>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.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--on-error-stop</code></span></dt>\n<dd>\n<p>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.</p>\n<p>Note that index checking always stops after the first corrupt page. This option only has meaning relative to table relations.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--skip=<em class=\"replaceable\"><code>option</code></em></code></span></dt>\n<dd>\n<p>If <code class=\"literal\">all-frozen</code> is given, table corruption checks will skip over pages in all tables that are marked as all frozen.</p>\n<p>If <code class=\"literal\">all-visible</code> is given, table corruption checks will skip over pages in all tables that are marked as all visible.</p>\n<p>By default, no pages are skipped. This can be specified as <code class=\"literal\">none</code>, but since this is the default, it need not be mentioned.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--startblock=<em class=\"replaceable\"><code>block</code></em></code></span></dt>\n<dd>\n<p>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 <code class=\"literal\">--endblock</code> for further caveats.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--endblock=<em class=\"replaceable\"><code>block</code></em></code></span></dt>\n<dd>\n<p>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 <code class=\"option\">--exclude-toast-pointers</code>.</p>\n</dd>\n</dl>\n</div>\n<p>The following command-line options control checking of B-tree indexes:</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">--checkunique</code></span></dt>\n<dd>\n<p>For each index with unique constraint checked, verify that no more than one among duplicate entries is visible in the index using <a class=\"xref\" href=\"/docs/18/amcheck.html\" title=\"F.1.\u00a0amcheck \u2014 tools to verify table and index consistency\">amcheck</a>'s <code class=\"option\">checkunique</code> option.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--heapallindexed</code></span></dt>\n<dd>\n<p>For each index checked, verify the presence of all heap tuples as index tuples in the index using <a class=\"xref\" href=\"/docs/18/amcheck.html\" title=\"F.1.\u00a0amcheck \u2014 tools to verify table and index consistency\">amcheck</a>'s <code class=\"option\">heapallindexed</code> option.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--parent-check</code></span></dt>\n<dd>\n<p>For each btree index checked, use <a class=\"xref\" href=\"/docs/18/amcheck.html\" title=\"F.1.\u00a0amcheck \u2014 tools to verify table and index consistency\">amcheck</a>'s <code class=\"function\">bt_index_parent_check</code> function, which performs additional checks of parent/child relationships during index checking.</p>\n<p>The default is to use <span class=\"application\">amcheck</span>'s <code class=\"function\">bt_index_check</code> function, but note that use of the <code class=\"option\">--rootdescend</code> option implicitly selects <code class=\"function\">bt_index_parent_check</code>.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--rootdescend</code></span></dt>\n<dd>\n<p>For each index checked, re-find tuples on the leaf level by performing a new search from the root page for each tuple using <a class=\"xref\" href=\"/docs/18/amcheck.html\" title=\"F.1.\u00a0amcheck \u2014 tools to verify table and index consistency\">amcheck</a>'s <code class=\"option\">rootdescend</code> option.</p>\n<p>Use of this option implicitly also selects the <code class=\"option\">--parent-check</code> option.</p>\n<p>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.</p>\n</dd>\n</dl>\n</div>\n<div class=\"warning\">\n<h3 class=\"title\">Warning</h3>\n<p>The extra checks performed against B-tree indexes when the <code class=\"option\">--parent-check</code> option or the <code class=\"option\">--rootdescend</code> option is specified require relatively strong relation-level locks. These checks are the only checks that will block concurrent data modification from <code class=\"command\">INSERT</code>, <code class=\"command\">UPDATE</code>, and <code class=\"command\">DELETE</code> commands.</p>\n</div>\n<p>The following command-line options control the connection to the server:</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-h <em class=\"replaceable\"><code>hostname</code></em></code><br></span><span class=\"term\"><code class=\"option\">--host=<em class=\"replaceable\"><code>hostname</code></em></code></span></dt>\n<dd>\n<p>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.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-p <em class=\"replaceable\"><code>port</code></em></code><br></span><span class=\"term\"><code class=\"option\">--port=<em class=\"replaceable\"><code>port</code></em></code></span></dt>\n<dd>\n<p>Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-U</code><br></span><span class=\"term\"><code class=\"option\">--username=<em class=\"replaceable\"><code>username</code></em></code></span></dt>\n<dd>\n<p>User name to connect as.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-w</code><br></span><span class=\"term\"><code class=\"option\">--no-password</code></span></dt>\n<dd>\n<p>Never issue a password prompt. If the server requires password authentication and a password is not available by other means such as a <code class=\"filename\">.pgpass</code> 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.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-W</code><br></span><span class=\"term\"><code class=\"option\">--password</code></span></dt>\n<dd>\n<p>Force <span class=\"application\">pg_amcheck</span> to prompt for a password before connecting to a database.</p>\n<p>This option is never essential, since <span class=\"application\">pg_amcheck</span> will automatically prompt for a password if the server demands password authentication. However, <span class=\"application\">pg_amcheck</span> will waste a connection attempt finding out that the server wants a password. In some cases it is worth typing <code class=\"option\">-W</code> to avoid the extra connection attempt.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--maintenance-db=<em class=\"replaceable\"><code>dbname</code></em></code></span></dt>\n<dd>\n<p>Specifies a database or <a class=\"link\" href=\"/docs/18/libpq-connect.html#LIBPQ-CONNSTRING\" title=\"32.1.1.\u00a0Connection Strings\">connection string</a> to be used to discover the list of databases to be checked. If neither <code class=\"option\">--all</code> 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 <code class=\"literal\">postgres</code> or, if that fails, <code class=\"literal\">template1</code>.</p>\n</dd>\n</dl>\n</div>\n<p>Other options are also available:</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-e</code><br></span><span class=\"term\"><code class=\"option\">--echo</code></span></dt>\n<dd>\n<p>Echo to stdout all SQL sent to the server.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-j <em class=\"replaceable\"><code>num</code></em></code><br></span><span class=\"term\"><code class=\"option\">--jobs=<em class=\"replaceable\"><code>num</code></em></code></span></dt>\n<dd>\n<p>Use <em class=\"replaceable\"><code>num</code></em> concurrent connections to the server, or one per object to be checked, whichever is less.</p>\n<p>The default is to use a single connection.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-P</code><br></span><span class=\"term\"><code class=\"option\">--progress</code></span></dt>\n<dd>\n<p>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.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-v</code><br></span><span class=\"term\"><code class=\"option\">--verbose</code></span></dt>\n<dd>\n<p>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.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-V</code><br></span><span class=\"term\"><code class=\"option\">--version</code></span></dt>\n<dd>\n<p>Print the <span class=\"application\">pg_amcheck</span> version and exit.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--install-missing</code><br></span><span class=\"term\"><code class=\"option\">--install-missing=<em class=\"replaceable\"><code>schema</code></em></code></span></dt>\n<dd>\n<p>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 <em class=\"replaceable\"><code>schema</code></em>, or if not specified into schema <code class=\"literal\">pg_catalog</code>.</p>\n<p>At present, the only required extension is <a class=\"xref\" href=\"/docs/18/amcheck.html\" title=\"F.1.\u00a0amcheck \u2014 tools to verify table and index consistency\">amcheck</a>.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-?</code><br></span><span class=\"term\"><code class=\"option\">--help</code></span></dt>\n<dd>\n<p>Show help about <span class=\"application\">pg_amcheck</span> command line arguments, and exit.</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.4.9.7\">\n<h2>Environment</h2>\n<p><code class=\"command\">pg_amcheck</code>, like most other <span class=\"productname\">PostgreSQL</span> utilities, also uses the environment variables supported by <span class=\"application\">libpq</span> (see <a class=\"xref\" href=\"/docs/18/libpq-envars.html\" title=\"32.15.\u00a0Environment Variables\">Section\u00a032.15</a>).</p>\n<p>The environment variable <code class=\"envar\">PG_COLOR</code> specifies whether to use color in diagnostic messages. Possible values are <code class=\"literal\">always</code>, <code class=\"literal\">auto</code> and <code class=\"literal\">never</code>.</p>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.4.9.8\">\n<h2>Notes</h2>\n<p><span class=\"application\">pg_amcheck</span> is designed to work with <span class=\"productname\">PostgreSQL</span> 14.0 and later.</p>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.4.9.9\">\n<h2>See Also</h2><span class=\"simplelist\"><a class=\"xref\" href=\"/docs/18/amcheck.html\" title=\"F.1.\u00a0amcheck \u2014 tools to verify table and index consistency\">amcheck</a></span>\n</div>\n</div></div>", "manual_path": "app-pgamcheck.html", "comparison_data": {"options": [{"names": ["-a", "--all"], "signature": "-a --all", "description": "Check all databases, except for any excluded via --exclude-database ."}, {"names": ["-d pattern", "--database= pattern"], "signature": "-d pattern --database= pattern", "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", "--exclude-database= pattern"], "signature": "-D pattern --exclude-database= pattern", "description": "Exclude databases matching the given pattern . This option can be specified more than once."}, {"names": ["-i pattern", "--index= pattern"], "signature": "-i pattern --index= 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", "--exclude-index= pattern"], "signature": "-I pattern --exclude-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": ["-r pattern", "--relation= pattern"], "signature": "-r pattern --relation= 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", "--exclude-relation= pattern"], "signature": "-R pattern --exclude-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": ["-s pattern", "--schema= pattern"], "signature": "-s pattern --schema= 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", "--exclude-schema= pattern"], "signature": "-S pattern --exclude-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": ["-t pattern", "--table= pattern"], "signature": "-t pattern --table= 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", "--exclude-table= pattern"], "signature": "-T pattern --exclude-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": ["--no-dependent-indexes"], "signature": "--no-dependent-indexes", "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-toast"], "signature": "--no-dependent-toast", "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-strict-names"], "signature": "--no-strict-names", "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": ["--exclude-toast-pointers"], "signature": "--exclude-toast-pointers", "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": ["--on-error-stop"], "signature": "--on-error-stop", "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": ["--skip= option"], "signature": "--skip= option", "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": ["--startblock= block"], "signature": "--startblock= block", "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": ["--endblock= block"], "signature": "--endblock= 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": ["--checkunique"], "signature": "--checkunique", "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": ["--heapallindexed"], "signature": "--heapallindexed", "description": "For each index checked, verify the presence of all heap tuples as index tuples in the index using amcheck 's heapallindexed option."}, {"names": ["--parent-check"], "signature": "--parent-check", "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": ["--rootdescend"], "signature": "--rootdescend", "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": ["-h hostname", "--host= hostname"], "signature": "-h hostname --host= hostname", "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": ["-p port", "--port= port"], "signature": "-p port --port= port", "description": "Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections."}, {"names": ["-U", "--username= username"], "signature": "-U --username= username", "description": "User name to connect as."}, {"names": ["-w", "--no-password"], "signature": "-w --no-password", "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", "--password"], "signature": "-W --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": ["--maintenance-db= dbname"], "signature": "--maintenance-db= dbname", "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": ["-e", "--echo"], "signature": "-e --echo", "description": "Echo to stdout all SQL sent to the server."}, {"names": ["-j num", "--jobs= num"], "signature": "-j num --jobs= num", "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": ["-P", "--progress"], "signature": "-P --progress", "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": ["-v", "--verbose"], "signature": "-v --verbose", "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", "--version"], "signature": "-V --version", "description": "Print the pg_amcheck version and exit."}, {"names": ["--install-missing", "--install-missing= schema"], "signature": "--install-missing --install-missing= schema", "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": ["-?", "--help"], "signature": "-? --help", "description": "Show help about pg_amcheck command line arguments, and exit."}], "synopsis": ["pg_amcheck [ option ...] [ dbname ]"], "environment": []}, "comparison_hash": "e007a3ce54383d588583bd426bfaa62aba42504ba26ff80ad24c0c65d13af539"}, "19": {"facts": [{"label": "Documented executable", "value": "pg_amcheck"}, {"label": "Executable version", "value": "19beta4"}, {"label": "Reference inventory", "value": "Client applications"}, {"label": "Option definition groups", "value": "36"}], "tables": [{"key": "options", "rows": [{"summary": "Check all databases, except for any excluded via --exclude-database .", "signature": {"url": "/docs/19/app-pgamcheck.html", "text": "-a --all"}}, {"summary": "Check databases matching the specified pattern , except for any excluded by --exclude-database . This option can be specified more than once.", "signature": {"url": "/docs/19/app-pgamcheck.html", "text": "-d pattern --database= pattern"}}, {"summary": "Exclude databases matching the given pattern . This option can be specified more than once.", "signature": {"url": "/docs/19/app-pgamcheck.html", "text": "-D pattern --exclude-database= pattern"}}, {"summary": "Check indexes matching the specified pattern , unless they are otherwise excluded. This option can be specified more than once.", "signature": {"url": "/docs/19/app-pgamcheck.html", "text": "-i pattern --index= pattern"}}, {"summary": "Exclude indexes matching the specified pattern . This option can be specified more than once.", "signature": {"url": "/docs/19/app-pgamcheck.html", "text": "-I pattern --exclude-index= pattern"}}, {"summary": "Check relations matching the specified pattern , unless they are otherwise excluded. This option can be specified more than once.", "signature": {"url": "/docs/19/app-pgamcheck.html", "text": "-r pattern --relation= pattern"}}, {"summary": "Exclude relations matching the specified pattern . This option can be specified more than once.", "signature": {"url": "/docs/19/app-pgamcheck.html", "text": "-R pattern --exclude-relation= pattern"}}, {"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": {"url": "/docs/19/app-pgamcheck.html", "text": "-s pattern --schema= pattern"}}, {"summary": "Exclude tables and indexes in schemas matching the specified pattern . This option can be specified more than once.", "signature": {"url": "/docs/19/app-pgamcheck.html", "text": "-S pattern --exclude-schema= pattern"}}, {"summary": "Check tables matching the specified pattern , unless they are otherwise excluded. This option can be specified more than once.", "signature": {"url": "/docs/19/app-pgamcheck.html", "text": "-t pattern --table= pattern"}}, {"summary": "Exclude tables matching the specified pattern . This option can be specified more than once.", "signature": {"url": "/docs/19/app-pgamcheck.html", "text": "-T pattern --exclude-table= pattern"}}, {"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": {"url": "/docs/19/app-pgamcheck.html", "text": "--no-dependent-indexes"}}, {"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": {"url": "/docs/19/app-pgamcheck.html", "text": "--no-dependent-toast"}}, {"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": {"url": "/docs/19/app-pgamcheck.html", "text": "--no-strict-names"}}, {"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": {"url": "/docs/19/app-pgamcheck.html", "text": "--exclude-toast-pointers"}}, {"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": {"url": "/docs/19/app-pgamcheck.html", "text": "--on-error-stop"}}, {"summary": "If all-frozen is given, table corruption checks will skip over pages in all tables that are marked as all frozen.", "signature": {"url": "/docs/19/app-pgamcheck.html", "text": "--skip= option"}}, {"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": {"url": "/docs/19/app-pgamcheck.html", "text": "--startblock= block"}}, {"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": {"url": "/docs/19/app-pgamcheck.html", "text": "--endblock= block"}}, {"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": {"url": "/docs/19/app-pgamcheck.html", "text": "--checkunique"}}, {"summary": "For each index checked, verify the presence of all heap tuples as index tuples in the index using amcheck 's heapallindexed option.", "signature": {"url": "/docs/19/app-pgamcheck.html", "text": "--heapallindexed"}}, {"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": {"url": "/docs/19/app-pgamcheck.html", "text": "--parent-check"}}, {"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": {"url": "/docs/19/app-pgamcheck.html", "text": "--rootdescend"}}, {"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": {"url": "/docs/19/app-pgamcheck.html", "text": "-h hostname --host= hostname"}}, {"summary": "Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections.", "signature": {"url": "/docs/19/app-pgamcheck.html", "text": "-p port --port= port"}}, {"summary": "User name to connect as.", "signature": {"url": "/docs/19/app-pgamcheck.html", "text": "-U --username= username"}}, {"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": {"url": "/docs/19/app-pgamcheck.html", "text": "-w --no-password"}}, {"summary": "Force pg_amcheck to prompt for a password before connecting to a database.", "signature": {"url": "/docs/19/app-pgamcheck.html", "text": "-W --password"}}, {"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": {"url": "/docs/19/app-pgamcheck.html", "text": "--maintenance-db= dbname"}}, {"summary": "Echo to stdout all SQL sent to the server.", "signature": {"url": "/docs/19/app-pgamcheck.html", "text": "-e --echo"}}, {"summary": "Use num concurrent connections to the server, or one per object to be checked, whichever is less.", "signature": {"url": "/docs/19/app-pgamcheck.html", "text": "-j num --jobs= num"}}, {"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": {"url": "/docs/19/app-pgamcheck.html", "text": "-P --progress"}}, {"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": {"url": "/docs/19/app-pgamcheck.html", "text": "-v --verbose"}}, {"summary": "Print the pg_amcheck version and exit.", "signature": {"url": "/docs/19/app-pgamcheck.html", "text": "-V --version"}}, {"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": {"url": "/docs/19/app-pgamcheck.html", "text": "--install-missing --install-missing= schema"}}, {"summary": "Show help about pg_amcheck command line arguments, and exit.", "signature": {"url": "/docs/19/app-pgamcheck.html", "text": "-? --help"}}], "title": "Documented options", "columns": [{"key": "signature", "label": "Option and arguments"}, {"key": "summary", "label": "Description"}]}], "options": [{"names": ["-a", "--all"], "summary": "Check all databases, except for any excluded via --exclude-database .", "signature": "-a --all", "source_url": "/docs/19/app-pgamcheck.html", "description": "Check all databases, except for any excluded via --exclude-database ."}, {"names": ["-d pattern", "--database= pattern"], "summary": "Check databases matching the specified pattern , except for any excluded by --exclude-database . This option can be specified more than once.", "signature": "-d pattern --database= pattern", "source_url": "/docs/19/app-pgamcheck.html", "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", "--exclude-database= pattern"], "summary": "Exclude databases matching the given pattern . This option can be specified more than once.", "signature": "-D pattern --exclude-database= pattern", "source_url": "/docs/19/app-pgamcheck.html", "description": "Exclude databases matching the given pattern . This option can be specified more than once."}, {"names": ["-i pattern", "--index= pattern"], "summary": "Check indexes matching the specified pattern , unless they are otherwise excluded. This option can be specified more than once.", "signature": "-i pattern --index= pattern", "source_url": "/docs/19/app-pgamcheck.html", "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", "--exclude-index= pattern"], "summary": "Exclude indexes matching the specified pattern . This option can be specified more than once.", "signature": "-I pattern --exclude-index= pattern", "source_url": "/docs/19/app-pgamcheck.html", "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": ["-r pattern", "--relation= pattern"], "summary": "Check relations matching the specified pattern , unless they are otherwise excluded. This option can be specified more than once.", "signature": "-r pattern --relation= pattern", "source_url": "/docs/19/app-pgamcheck.html", "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", "--exclude-relation= pattern"], "summary": "Exclude relations matching the specified pattern . This option can be specified more than once.", "signature": "-R pattern --exclude-relation= pattern", "source_url": "/docs/19/app-pgamcheck.html", "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": ["-s pattern", "--schema= pattern"], "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": "-s pattern --schema= pattern", "source_url": "/docs/19/app-pgamcheck.html", "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", "--exclude-schema= pattern"], "summary": "Exclude tables and indexes in schemas matching the specified pattern . This option can be specified more than once.", "signature": "-S pattern --exclude-schema= pattern", "source_url": "/docs/19/app-pgamcheck.html", "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": ["-t pattern", "--table= pattern"], "summary": "Check tables matching the specified pattern , unless they are otherwise excluded. This option can be specified more than once.", "signature": "-t pattern --table= pattern", "source_url": "/docs/19/app-pgamcheck.html", "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", "--exclude-table= pattern"], "summary": "Exclude tables matching the specified pattern . This option can be specified more than once.", "signature": "-T pattern --exclude-table= pattern", "source_url": "/docs/19/app-pgamcheck.html", "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": ["--no-dependent-indexes"], "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": "--no-dependent-indexes", "source_url": "/docs/19/app-pgamcheck.html", "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-toast"], "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": "--no-dependent-toast", "source_url": "/docs/19/app-pgamcheck.html", "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-strict-names"], "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": "--no-strict-names", "source_url": "/docs/19/app-pgamcheck.html", "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": ["--exclude-toast-pointers"], "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": "--exclude-toast-pointers", "source_url": "/docs/19/app-pgamcheck.html", "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": ["--on-error-stop"], "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": "--on-error-stop", "source_url": "/docs/19/app-pgamcheck.html", "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": ["--skip= option"], "summary": "If all-frozen is given, table corruption checks will skip over pages in all tables that are marked as all frozen.", "signature": "--skip= option", "source_url": "/docs/19/app-pgamcheck.html", "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": ["--startblock= block"], "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": "--startblock= block", "source_url": "/docs/19/app-pgamcheck.html", "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": ["--endblock= block"], "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": "--endblock= block", "source_url": "/docs/19/app-pgamcheck.html", "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": ["--checkunique"], "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": "--checkunique", "source_url": "/docs/19/app-pgamcheck.html", "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": ["--heapallindexed"], "summary": "For each index checked, verify the presence of all heap tuples as index tuples in the index using amcheck 's heapallindexed option.", "signature": "--heapallindexed", "source_url": "/docs/19/app-pgamcheck.html", "description": "For each index checked, verify the presence of all heap tuples as index tuples in the index using amcheck 's heapallindexed option."}, {"names": ["--parent-check"], "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": "--parent-check", "source_url": "/docs/19/app-pgamcheck.html", "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": ["--rootdescend"], "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": "--rootdescend", "source_url": "/docs/19/app-pgamcheck.html", "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": ["-h hostname", "--host= hostname"], "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": "-h hostname --host= hostname", "source_url": "/docs/19/app-pgamcheck.html", "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": ["-p port", "--port= port"], "summary": "Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections.", "signature": "-p port --port= port", "source_url": "/docs/19/app-pgamcheck.html", "description": "Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections."}, {"names": ["-U", "--username= username"], "summary": "User name to connect as.", "signature": "-U --username= username", "source_url": "/docs/19/app-pgamcheck.html", "description": "User name to connect as."}, {"names": ["-w", "--no-password"], "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": "-w --no-password", "source_url": "/docs/19/app-pgamcheck.html", "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", "--password"], "summary": "Force pg_amcheck to prompt for a password before connecting to a database.", "signature": "-W --password", "source_url": "/docs/19/app-pgamcheck.html", "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": ["--maintenance-db= dbname"], "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": "--maintenance-db= dbname", "source_url": "/docs/19/app-pgamcheck.html", "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": ["-e", "--echo"], "summary": "Echo to stdout all SQL sent to the server.", "signature": "-e --echo", "source_url": "/docs/19/app-pgamcheck.html", "description": "Echo to stdout all SQL sent to the server."}, {"names": ["-j num", "--jobs= num"], "summary": "Use num concurrent connections to the server, or one per object to be checked, whichever is less.", "signature": "-j num --jobs= num", "source_url": "/docs/19/app-pgamcheck.html", "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": ["-P", "--progress"], "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": "-P --progress", "source_url": "/docs/19/app-pgamcheck.html", "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": ["-v", "--verbose"], "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": "-v --verbose", "source_url": "/docs/19/app-pgamcheck.html", "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", "--version"], "summary": "Print the pg_amcheck version and exit.", "signature": "-V --version", "source_url": "/docs/19/app-pgamcheck.html", "description": "Print the pg_amcheck version and exit."}, {"names": ["--install-missing", "--install-missing= schema"], "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": "--install-missing --install-missing= schema", "source_url": "/docs/19/app-pgamcheck.html", "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": ["-?", "--help"], "summary": "Show help about pg_amcheck command line arguments, and exit.", "signature": "-? --help", "source_url": "/docs/19/app-pgamcheck.html", "description": "Show help about pg_amcheck command line arguments, and exit."}], "related": [], "release": {"ref": "https://ftp.postgresql.org/pub/source/v19beta4/postgresql-19beta4.tar.bz2", "label": "19beta4", "major": "19", "channel": "preview", "manifest": {"pdf": {"A4": {"url": "/files/documentation/pdf/19/postgresql-19-A4.pdf", "bytes": 16064841, "pages": 3052, "sha256": "4dd099e4125c591128fc5f3ebd02178dc24781f9e5ae629f96d67c4c8547427b", "built_at": "2026-09-26"}, "US": {"url": "/files/documentation/pdf/19/postgresql-19-US.pdf", "bytes": 15974616, "pages": 3225, "sha256": "61971fa857f0956d47341a0388fa6af9ae10acf691d4b2fc009007d384b0342b", "built_at": "2026-09-26"}}, "tree": "19", "index": "index.html", "major": "19", "pages": 1155, "release": "19beta4", "source_url": "https://ftp.postgresql.org/pub/source/v19beta4/postgresql-19beta4.tar.bz2", "svg_assets": 5, "source_mode": "en SGML built with pinned official archive", "source_sha256": "83157ee9c599d03b2f7a3d73ef3a56ec24e0e79cc2b3501a64d1364f56398c86"}, "revision": "1bbbbf4133d426f0e4304010688d2984c30fb67df0cc3a61b3e37eb3f6f37833", "evidence_kind": "English manual and source declarations", "source_sha256": "83157ee9c599d03b2f7a3d73ef3a56ec24e0e79cc2b3501a64d1364f56398c86"}, "sources": [{"url": "/docs/19/app-pgamcheck.html", "file": "app-pgamcheck.html", "label": "19beta4 English manual \u00b7 app-pgamcheck.html", "anchor": "", "sha256": "7badce507561ff8d1e103126b9c6be4c490212a82057791a74532e5e17345d89"}, {"url": "/docs/19/reference-client.html", "file": "reference-client.html", "label": "Client applications inventory", "anchor": "", "sha256": "c827f460db781b39da305303c88e73729a419cd2b2b9dedb126d8ad5cbf02c95"}], "sections": [], "synopsis": ["pg_amcheck [ option ...] [ dbname ]"], "signature": "pg_amcheck [ option ...] [ dbname ]", "description": ["pg_amcheck \u2014 checks for corruption in one or more PostgreSQL databases"], "environment": [], "manual_html": "<div><div class=\"refentry\" id=\"APP-PGAMCHECK\">\n<div class=\"titlepage\"></div>\n<div class=\"refnamediv\">\n<h2><span class=\"refentrytitle\"><span class=\"application\">pg_amcheck</span></span></h2>\n<p>pg_amcheck \u2014 checks for corruption in one or more <span class=\"productname\">PostgreSQL</span> databases</p>\n</div>\n<div class=\"refsynopsisdiv\">\n<h2>Synopsis</h2>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.4.9.4.1\"><code class=\"command\">pg_amcheck</code> [<em class=\"replaceable\"><code>option</code></em>...] [<em class=\"replaceable\"><code>dbname</code></em>]</p>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.4.9.5\">\n<h2>Description</h2>\n<p><span class=\"application\">pg_amcheck</span> supports running <a class=\"xref\" href=\"/docs/19/amcheck.html\" title=\"F.1.\u00a0amcheck \u2014 tools to verify table and index consistency\">amcheck</a>'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.</p>\n<p>Only ordinary and TOAST table relations, materialized views, sequences, and btree indexes are currently supported. Other relation types are silently skipped.</p>\n<p>If <code class=\"literal\">dbname</code> 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 <code class=\"option\">--all</code>, <code class=\"option\">--database</code> and <code class=\"option\">--exclude-database</code>. They also include <code class=\"option\">--relation</code>, <code class=\"option\">--exclude-relation</code>, <code class=\"option\">--table</code>, <code class=\"option\">--exclude-table</code>, <code class=\"option\">--index</code>, and <code class=\"option\">--exclude-index</code>, but only when such options are used with a three-part pattern (e.g. <code class=\"option\">mydb*.myschema*.myrel*</code>). Finally, they include <code class=\"option\">--schema</code> and <code class=\"option\">--exclude-schema</code> when such options are used with a two-part pattern (e.g. <code class=\"option\">mydb*.myschema*</code>).</p>\n<p><em class=\"replaceable\"><code>dbname</code></em> can also be a <a class=\"link\" href=\"/docs/19/libpq-connect.html#LIBPQ-CONNSTRING\" title=\"32.1.1.\u00a0Connection Strings\">connection string</a>.</p>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.4.9.6\">\n<h2>Options</h2>\n<p>The following command-line options control what is checked:</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-a</code><br></span><span class=\"term\"><code class=\"option\">--all</code></span></dt>\n<dd>\n<p>Check all databases, except for any excluded via <code class=\"option\">--exclude-database</code>.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-d <em class=\"replaceable\"><code>pattern</code></em></code><br></span><span class=\"term\"><code class=\"option\">--database=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p>Check databases matching the specified <a class=\"link\" href=\"/docs/19/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"><em class=\"replaceable\"><code>pattern</code></em></a>, except for any excluded by <code class=\"option\">--exclude-database</code>. This option can be specified more than once.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-D <em class=\"replaceable\"><code>pattern</code></em></code><br></span><span class=\"term\"><code class=\"option\">--exclude-database=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p>Exclude databases matching the given <a class=\"link\" href=\"/docs/19/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"><em class=\"replaceable\"><code>pattern</code></em></a>. This option can be specified more than once.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-i <em class=\"replaceable\"><code>pattern</code></em></code><br></span><span class=\"term\"><code class=\"option\">--index=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p>Check indexes matching the specified <a class=\"link\" href=\"/docs/19/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"><em class=\"replaceable\"><code>pattern</code></em></a>, unless they are otherwise excluded. This option can be specified more than once.</p>\n<p>This is similar to the <code class=\"option\">--relation</code> option, except that it applies only to indexes, not to other relation types.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-I <em class=\"replaceable\"><code>pattern</code></em></code><br></span><span class=\"term\"><code class=\"option\">--exclude-index=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p>Exclude indexes matching the specified <a class=\"link\" href=\"/docs/19/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"><em class=\"replaceable\"><code>pattern</code></em></a>. This option can be specified more than once.</p>\n<p>This is similar to the <code class=\"option\">--exclude-relation</code> option, except that it applies only to indexes, not other relation types.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-r <em class=\"replaceable\"><code>pattern</code></em></code><br></span><span class=\"term\"><code class=\"option\">--relation=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p>Check relations matching the specified <a class=\"link\" href=\"/docs/19/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"><em class=\"replaceable\"><code>pattern</code></em></a>, unless they are otherwise excluded. This option can be specified more than once.</p>\n<p>Patterns may be unqualified, e.g. <code class=\"literal\">myrel*</code>, or they may be schema-qualified, e.g. <code class=\"literal\">myschema*.myrel*</code> or database-qualified and schema-qualified, e.g. <code class=\"literal\">mydb*.myschema*.myrel*</code>. A database-qualified pattern will add matching databases to the list of databases to be checked.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-R <em class=\"replaceable\"><code>pattern</code></em></code><br></span><span class=\"term\"><code class=\"option\">--exclude-relation=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p>Exclude relations matching the specified <a class=\"link\" href=\"/docs/19/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"><em class=\"replaceable\"><code>pattern</code></em></a>. This option can be specified more than once.</p>\n<p>As with <code class=\"option\">--relation</code>, the <a class=\"link\" href=\"/docs/19/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"><em class=\"replaceable\"><code>pattern</code></em></a> may be unqualified, schema-qualified, or database- and schema-qualified.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-s <em class=\"replaceable\"><code>pattern</code></em></code><br></span><span class=\"term\"><code class=\"option\">--schema=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p>Check tables and indexes in schemas matching the specified <a class=\"link\" href=\"/docs/19/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"><em class=\"replaceable\"><code>pattern</code></em></a>, unless they are otherwise excluded. This option can be specified more than once.</p>\n<p>To select only tables in schemas matching a particular pattern, consider using something like <code class=\"literal\">--table=SCHEMAPAT.* --no-dependent-indexes</code>. To select only indexes, consider using something like <code class=\"literal\">--index=SCHEMAPAT.*</code>.</p>\n<p>A schema pattern may be database-qualified. For example, you may write <code class=\"literal\">--schema=mydb*.myschema*</code> to select schemas matching <code class=\"literal\">myschema*</code> in databases matching <code class=\"literal\">mydb*</code>.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-S <em class=\"replaceable\"><code>pattern</code></em></code><br></span><span class=\"term\"><code class=\"option\">--exclude-schema=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p>Exclude tables and indexes in schemas matching the specified <a class=\"link\" href=\"/docs/19/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"><em class=\"replaceable\"><code>pattern</code></em></a>. This option can be specified more than once.</p>\n<p>As with <code class=\"option\">--schema</code>, the pattern may be database-qualified.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-t <em class=\"replaceable\"><code>pattern</code></em></code><br></span><span class=\"term\"><code class=\"option\">--table=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p>Check tables matching the specified <a class=\"link\" href=\"/docs/19/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"><em class=\"replaceable\"><code>pattern</code></em></a>, unless they are otherwise excluded. This option can be specified more than once.</p>\n<p>This is similar to the <code class=\"option\">--relation</code> option, except that it applies only to tables, materialized views, and sequences, not to indexes.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-T <em class=\"replaceable\"><code>pattern</code></em></code><br></span><span class=\"term\"><code class=\"option\">--exclude-table=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p>Exclude tables matching the specified <a class=\"link\" href=\"/docs/19/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"><em class=\"replaceable\"><code>pattern</code></em></a>. This option can be specified more than once.</p>\n<p>This is similar to the <code class=\"option\">--exclude-relation</code> option, except that it applies only to tables, materialized views, and sequences, not to indexes.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-dependent-indexes</code></span></dt>\n<dd>\n<p>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 <code class=\"literal\">--index</code> or <code class=\"literal\">--relation</code>. This option suppresses that behavior.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-dependent-toast</code></span></dt>\n<dd>\n<p>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 <code class=\"literal\">--table</code> or <code class=\"literal\">--relation</code>. This option suppresses that behavior.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-strict-names</code></span></dt>\n<dd>\n<p>By default, if an argument to <code class=\"literal\">--database</code>, <code class=\"literal\">--table</code>, <code class=\"literal\">--index</code>, or <code class=\"literal\">--relation</code> matches no objects, it is a fatal error. This option downgrades that error to a warning.</p>\n</dd>\n</dl>\n</div>\n<p>The following command-line options control checking of tables:</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">--exclude-toast-pointers</code></span></dt>\n<dd>\n<p>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.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--on-error-stop</code></span></dt>\n<dd>\n<p>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.</p>\n<p>Note that index checking always stops after the first corrupt page. This option only has meaning relative to table relations.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--skip=<em class=\"replaceable\"><code>option</code></em></code></span></dt>\n<dd>\n<p>If <code class=\"literal\">all-frozen</code> is given, table corruption checks will skip over pages in all tables that are marked as all frozen.</p>\n<p>If <code class=\"literal\">all-visible</code> is given, table corruption checks will skip over pages in all tables that are marked as all visible.</p>\n<p>By default, no pages are skipped. This can be specified as <code class=\"literal\">none</code>, but since this is the default, it need not be mentioned.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--startblock=<em class=\"replaceable\"><code>block</code></em></code></span></dt>\n<dd>\n<p>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 <code class=\"literal\">--endblock</code> for further caveats.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--endblock=<em class=\"replaceable\"><code>block</code></em></code></span></dt>\n<dd>\n<p>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 <code class=\"option\">--exclude-toast-pointers</code>.</p>\n</dd>\n</dl>\n</div>\n<p>The following command-line options control checking of B-tree indexes:</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">--checkunique</code></span></dt>\n<dd>\n<p>For each index with unique constraint checked, verify that no more than one among duplicate entries is visible in the index using <a class=\"xref\" href=\"/docs/19/amcheck.html\" title=\"F.1.\u00a0amcheck \u2014 tools to verify table and index consistency\">amcheck</a>'s <code class=\"option\">checkunique</code> option.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--heapallindexed</code></span></dt>\n<dd>\n<p>For each index checked, verify the presence of all heap tuples as index tuples in the index using <a class=\"xref\" href=\"/docs/19/amcheck.html\" title=\"F.1.\u00a0amcheck \u2014 tools to verify table and index consistency\">amcheck</a>'s <code class=\"option\">heapallindexed</code> option.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--parent-check</code></span></dt>\n<dd>\n<p>For each btree index checked, use <a class=\"xref\" href=\"/docs/19/amcheck.html\" title=\"F.1.\u00a0amcheck \u2014 tools to verify table and index consistency\">amcheck</a>'s <code class=\"function\">bt_index_parent_check</code> function, which performs additional checks of parent/child relationships during index checking.</p>\n<p>The default is to use <span class=\"application\">amcheck</span>'s <code class=\"function\">bt_index_check</code> function, but note that use of the <code class=\"option\">--rootdescend</code> option implicitly selects <code class=\"function\">bt_index_parent_check</code>.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--rootdescend</code></span></dt>\n<dd>\n<p>For each index checked, re-find tuples on the leaf level by performing a new search from the root page for each tuple using <a class=\"xref\" href=\"/docs/19/amcheck.html\" title=\"F.1.\u00a0amcheck \u2014 tools to verify table and index consistency\">amcheck</a>'s <code class=\"option\">rootdescend</code> option.</p>\n<p>Use of this option implicitly also selects the <code class=\"option\">--parent-check</code> option.</p>\n<p>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.</p>\n</dd>\n</dl>\n</div>\n<div class=\"warning\">\n<h3 class=\"title\">Warning</h3>\n<p>The extra checks performed against B-tree indexes when the <code class=\"option\">--parent-check</code> option or the <code class=\"option\">--rootdescend</code> option is specified require relatively strong relation-level locks. These checks are the only checks that will block concurrent data modification from <code class=\"command\">INSERT</code>, <code class=\"command\">UPDATE</code>, and <code class=\"command\">DELETE</code> commands.</p>\n</div>\n<p>The following command-line options control the connection to the server:</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-h <em class=\"replaceable\"><code>hostname</code></em></code><br></span><span class=\"term\"><code class=\"option\">--host=<em class=\"replaceable\"><code>hostname</code></em></code></span></dt>\n<dd>\n<p>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.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-p <em class=\"replaceable\"><code>port</code></em></code><br></span><span class=\"term\"><code class=\"option\">--port=<em class=\"replaceable\"><code>port</code></em></code></span></dt>\n<dd>\n<p>Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-U</code><br></span><span class=\"term\"><code class=\"option\">--username=<em class=\"replaceable\"><code>username</code></em></code></span></dt>\n<dd>\n<p>User name to connect as.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-w</code><br></span><span class=\"term\"><code class=\"option\">--no-password</code></span></dt>\n<dd>\n<p>Never issue a password prompt. If the server requires password authentication and a password is not available by other means such as a <code class=\"filename\">.pgpass</code> 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.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-W</code><br></span><span class=\"term\"><code class=\"option\">--password</code></span></dt>\n<dd>\n<p>Force <span class=\"application\">pg_amcheck</span> to prompt for a password before connecting to a database.</p>\n<p>This option is never essential, since <span class=\"application\">pg_amcheck</span> will automatically prompt for a password if the server demands password authentication. However, <span class=\"application\">pg_amcheck</span> will waste a connection attempt finding out that the server wants a password. In some cases it is worth typing <code class=\"option\">-W</code> to avoid the extra connection attempt.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--maintenance-db=<em class=\"replaceable\"><code>dbname</code></em></code></span></dt>\n<dd>\n<p>Specifies a database or <a class=\"link\" href=\"/docs/19/libpq-connect.html#LIBPQ-CONNSTRING\" title=\"32.1.1.\u00a0Connection Strings\">connection string</a> to be used to discover the list of databases to be checked. If neither <code class=\"option\">--all</code> 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 <code class=\"literal\">postgres</code> or, if that fails, <code class=\"literal\">template1</code>.</p>\n</dd>\n</dl>\n</div>\n<p>Other options are also available:</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-e</code><br></span><span class=\"term\"><code class=\"option\">--echo</code></span></dt>\n<dd>\n<p>Echo to stdout all SQL sent to the server.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-j <em class=\"replaceable\"><code>num</code></em></code><br></span><span class=\"term\"><code class=\"option\">--jobs=<em class=\"replaceable\"><code>num</code></em></code></span></dt>\n<dd>\n<p>Use <em class=\"replaceable\"><code>num</code></em> concurrent connections to the server, or one per object to be checked, whichever is less.</p>\n<p>The default is to use a single connection.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-P</code><br></span><span class=\"term\"><code class=\"option\">--progress</code></span></dt>\n<dd>\n<p>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.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-v</code><br></span><span class=\"term\"><code class=\"option\">--verbose</code></span></dt>\n<dd>\n<p>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.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-V</code><br></span><span class=\"term\"><code class=\"option\">--version</code></span></dt>\n<dd>\n<p>Print the <span class=\"application\">pg_amcheck</span> version and exit.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--install-missing</code><br></span><span class=\"term\"><code class=\"option\">--install-missing=<em class=\"replaceable\"><code>schema</code></em></code></span></dt>\n<dd>\n<p>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 <em class=\"replaceable\"><code>schema</code></em>, or if not specified into schema <code class=\"literal\">pg_catalog</code>.</p>\n<p>At present, the only required extension is <a class=\"xref\" href=\"/docs/19/amcheck.html\" title=\"F.1.\u00a0amcheck \u2014 tools to verify table and index consistency\">amcheck</a>.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-?</code><br></span><span class=\"term\"><code class=\"option\">--help</code></span></dt>\n<dd>\n<p>Show help about <span class=\"application\">pg_amcheck</span> command line arguments, and exit.</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.4.9.7\">\n<h2>Environment</h2>\n<p><code class=\"command\">pg_amcheck</code>, like most other <span class=\"productname\">PostgreSQL</span> utilities, also uses the environment variables supported by <span class=\"application\">libpq</span> (see <a class=\"xref\" href=\"/docs/19/libpq-envars.html\" title=\"32.15.\u00a0Environment Variables\">Section\u00a032.15</a>).</p>\n<p>The environment variable <code class=\"envar\">PG_COLOR</code> specifies whether to use color in diagnostic messages. Possible values are <code class=\"literal\">always</code>, <code class=\"literal\">auto</code> and <code class=\"literal\">never</code>.</p>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.4.9.8\">\n<h2>Notes</h2>\n<p><span class=\"application\">pg_amcheck</span> is designed to work with <span class=\"productname\">PostgreSQL</span> 14.0 and later.</p>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.4.9.9\">\n<h2>See Also</h2><span class=\"simplelist\"><a class=\"xref\" href=\"/docs/19/amcheck.html\" title=\"F.1.\u00a0amcheck \u2014 tools to verify table and index consistency\">amcheck</a></span>\n</div>\n</div></div>", "manual_path": "app-pgamcheck.html", "comparison_data": {"options": [{"names": ["-a", "--all"], "signature": "-a --all", "description": "Check all databases, except for any excluded via --exclude-database ."}, {"names": ["-d pattern", "--database= pattern"], "signature": "-d pattern --database= pattern", "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", "--exclude-database= pattern"], "signature": "-D pattern --exclude-database= pattern", "description": "Exclude databases matching the given pattern . This option can be specified more than once."}, {"names": ["-i pattern", "--index= pattern"], "signature": "-i pattern --index= 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", "--exclude-index= pattern"], "signature": "-I pattern --exclude-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": ["-r pattern", "--relation= pattern"], "signature": "-r pattern --relation= 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", "--exclude-relation= pattern"], "signature": "-R pattern --exclude-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": ["-s pattern", "--schema= pattern"], "signature": "-s pattern --schema= 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", "--exclude-schema= pattern"], "signature": "-S pattern --exclude-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": ["-t pattern", "--table= pattern"], "signature": "-t pattern --table= 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", "--exclude-table= pattern"], "signature": "-T pattern --exclude-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": ["--no-dependent-indexes"], "signature": "--no-dependent-indexes", "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-toast"], "signature": "--no-dependent-toast", "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-strict-names"], "signature": "--no-strict-names", "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": ["--exclude-toast-pointers"], "signature": "--exclude-toast-pointers", "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": ["--on-error-stop"], "signature": "--on-error-stop", "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": ["--skip= option"], "signature": "--skip= option", "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": ["--startblock= block"], "signature": "--startblock= block", "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": ["--endblock= block"], "signature": "--endblock= 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": ["--checkunique"], "signature": "--checkunique", "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": ["--heapallindexed"], "signature": "--heapallindexed", "description": "For each index checked, verify the presence of all heap tuples as index tuples in the index using amcheck 's heapallindexed option."}, {"names": ["--parent-check"], "signature": "--parent-check", "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": ["--rootdescend"], "signature": "--rootdescend", "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": ["-h hostname", "--host= hostname"], "signature": "-h hostname --host= hostname", "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": ["-p port", "--port= port"], "signature": "-p port --port= port", "description": "Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections."}, {"names": ["-U", "--username= username"], "signature": "-U --username= username", "description": "User name to connect as."}, {"names": ["-w", "--no-password"], "signature": "-w --no-password", "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", "--password"], "signature": "-W --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": ["--maintenance-db= dbname"], "signature": "--maintenance-db= dbname", "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": ["-e", "--echo"], "signature": "-e --echo", "description": "Echo to stdout all SQL sent to the server."}, {"names": ["-j num", "--jobs= num"], "signature": "-j num --jobs= num", "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": ["-P", "--progress"], "signature": "-P --progress", "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": ["-v", "--verbose"], "signature": "-v --verbose", "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", "--version"], "signature": "-V --version", "description": "Print the pg_amcheck version and exit."}, {"names": ["--install-missing", "--install-missing= schema"], "signature": "--install-missing --install-missing= schema", "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": ["-?", "--help"], "signature": "-? --help", "description": "Show help about pg_amcheck command line arguments, and exit."}], "synopsis": ["pg_amcheck [ option ...] [ dbname ]"], "environment": []}, "comparison_hash": "1b5d8dc89b45637c0e8cd1b5f25a6ec2793afeadec9edeae24cdb512794aa018"}, "20": {"facts": [{"label": "Documented executable", "value": "pg_amcheck"}, {"label": "Executable version", "value": "20devel"}, {"label": "Reference inventory", "value": "Client applications"}, {"label": "Option definition groups", "value": "36"}], "tables": [{"key": "options", "rows": [{"summary": "Check all databases, except for any excluded via --exclude-database .", "signature": {"url": "/docs/devel/app-pgamcheck.html", "text": "-a --all"}}, {"summary": "Check databases matching the specified pattern , except for any excluded by --exclude-database . This option can be specified more than once.", "signature": {"url": "/docs/devel/app-pgamcheck.html", "text": "-d pattern --database= pattern"}}, {"summary": "Exclude databases matching the given pattern . This option can be specified more than once.", "signature": {"url": "/docs/devel/app-pgamcheck.html", "text": "-D pattern --exclude-database= pattern"}}, {"summary": "Check indexes matching the specified pattern , unless they are otherwise excluded. This option can be specified more than once.", "signature": {"url": "/docs/devel/app-pgamcheck.html", "text": "-i pattern --index= pattern"}}, {"summary": "Exclude indexes matching the specified pattern . This option can be specified more than once.", "signature": {"url": "/docs/devel/app-pgamcheck.html", "text": "-I pattern --exclude-index= pattern"}}, {"summary": "Check relations matching the specified pattern , unless they are otherwise excluded. This option can be specified more than once.", "signature": {"url": "/docs/devel/app-pgamcheck.html", "text": "-r pattern --relation= pattern"}}, {"summary": "Exclude relations matching the specified pattern . This option can be specified more than once.", "signature": {"url": "/docs/devel/app-pgamcheck.html", "text": "-R pattern --exclude-relation= pattern"}}, {"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": {"url": "/docs/devel/app-pgamcheck.html", "text": "-s pattern --schema= pattern"}}, {"summary": "Exclude tables and indexes in schemas matching the specified pattern . This option can be specified more than once.", "signature": {"url": "/docs/devel/app-pgamcheck.html", "text": "-S pattern --exclude-schema= pattern"}}, {"summary": "Check tables matching the specified pattern , unless they are otherwise excluded. This option can be specified more than once.", "signature": {"url": "/docs/devel/app-pgamcheck.html", "text": "-t pattern --table= pattern"}}, {"summary": "Exclude tables matching the specified pattern . This option can be specified more than once.", "signature": {"url": "/docs/devel/app-pgamcheck.html", "text": "-T pattern --exclude-table= pattern"}}, {"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": {"url": "/docs/devel/app-pgamcheck.html", "text": "--no-dependent-indexes"}}, {"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": {"url": "/docs/devel/app-pgamcheck.html", "text": "--no-dependent-toast"}}, {"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": {"url": "/docs/devel/app-pgamcheck.html", "text": "--no-strict-names"}}, {"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": {"url": "/docs/devel/app-pgamcheck.html", "text": "--exclude-toast-pointers"}}, {"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": {"url": "/docs/devel/app-pgamcheck.html", "text": "--on-error-stop"}}, {"summary": "If all-frozen is given, table corruption checks will skip over pages in all tables that are marked as all frozen.", "signature": {"url": "/docs/devel/app-pgamcheck.html", "text": "--skip= option"}}, {"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": {"url": "/docs/devel/app-pgamcheck.html", "text": "--startblock= block"}}, {"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": {"url": "/docs/devel/app-pgamcheck.html", "text": "--endblock= block"}}, {"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": {"url": "/docs/devel/app-pgamcheck.html", "text": "--checkunique"}}, {"summary": "For each index checked, verify the presence of all heap tuples as index tuples in the index using amcheck 's heapallindexed option.", "signature": {"url": "/docs/devel/app-pgamcheck.html", "text": "--heapallindexed"}}, {"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": {"url": "/docs/devel/app-pgamcheck.html", "text": "--parent-check"}}, {"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": {"url": "/docs/devel/app-pgamcheck.html", "text": "--rootdescend"}}, {"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": {"url": "/docs/devel/app-pgamcheck.html", "text": "-h hostname --host= hostname"}}, {"summary": "Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections.", "signature": {"url": "/docs/devel/app-pgamcheck.html", "text": "-p port --port= port"}}, {"summary": "User name to connect as.", "signature": {"url": "/docs/devel/app-pgamcheck.html", "text": "-U --username= username"}}, {"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": {"url": "/docs/devel/app-pgamcheck.html", "text": "-w --no-password"}}, {"summary": "Force pg_amcheck to prompt for a password before connecting to a database.", "signature": {"url": "/docs/devel/app-pgamcheck.html", "text": "-W --password"}}, {"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": {"url": "/docs/devel/app-pgamcheck.html", "text": "--maintenance-db= dbname"}}, {"summary": "Echo to stdout all SQL sent to the server.", "signature": {"url": "/docs/devel/app-pgamcheck.html", "text": "-e --echo"}}, {"summary": "Use num concurrent connections to the server, or one per object to be checked, whichever is less.", "signature": {"url": "/docs/devel/app-pgamcheck.html", "text": "-j num --jobs= num"}}, {"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": {"url": "/docs/devel/app-pgamcheck.html", "text": "-P --progress"}}, {"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": {"url": "/docs/devel/app-pgamcheck.html", "text": "-v --verbose"}}, {"summary": "Print the pg_amcheck version and exit.", "signature": {"url": "/docs/devel/app-pgamcheck.html", "text": "-V --version"}}, {"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": {"url": "/docs/devel/app-pgamcheck.html", "text": "--install-missing --install-missing= schema"}}, {"summary": "Show help about pg_amcheck command line arguments, and exit.", "signature": {"url": "/docs/devel/app-pgamcheck.html", "text": "-? --help"}}], "title": "Documented options", "columns": [{"key": "signature", "label": "Option and arguments"}, {"key": "summary", "label": "Description"}]}], "options": [{"names": ["-a", "--all"], "summary": "Check all databases, except for any excluded via --exclude-database .", "signature": "-a --all", "source_url": "/docs/devel/app-pgamcheck.html", "description": "Check all databases, except for any excluded via --exclude-database ."}, {"names": ["-d pattern", "--database= pattern"], "summary": "Check databases matching the specified pattern , except for any excluded by --exclude-database . This option can be specified more than once.", "signature": "-d pattern --database= pattern", "source_url": "/docs/devel/app-pgamcheck.html", "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", "--exclude-database= pattern"], "summary": "Exclude databases matching the given pattern . This option can be specified more than once.", "signature": "-D pattern --exclude-database= pattern", "source_url": "/docs/devel/app-pgamcheck.html", "description": "Exclude databases matching the given pattern . This option can be specified more than once."}, {"names": ["-i pattern", "--index= pattern"], "summary": "Check indexes matching the specified pattern , unless they are otherwise excluded. This option can be specified more than once.", "signature": "-i pattern --index= pattern", "source_url": "/docs/devel/app-pgamcheck.html", "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", "--exclude-index= pattern"], "summary": "Exclude indexes matching the specified pattern . This option can be specified more than once.", "signature": "-I pattern --exclude-index= pattern", "source_url": "/docs/devel/app-pgamcheck.html", "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": ["-r pattern", "--relation= pattern"], "summary": "Check relations matching the specified pattern , unless they are otherwise excluded. This option can be specified more than once.", "signature": "-r pattern --relation= pattern", "source_url": "/docs/devel/app-pgamcheck.html", "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", "--exclude-relation= pattern"], "summary": "Exclude relations matching the specified pattern . This option can be specified more than once.", "signature": "-R pattern --exclude-relation= pattern", "source_url": "/docs/devel/app-pgamcheck.html", "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": ["-s pattern", "--schema= pattern"], "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": "-s pattern --schema= pattern", "source_url": "/docs/devel/app-pgamcheck.html", "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", "--exclude-schema= pattern"], "summary": "Exclude tables and indexes in schemas matching the specified pattern . This option can be specified more than once.", "signature": "-S pattern --exclude-schema= pattern", "source_url": "/docs/devel/app-pgamcheck.html", "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": ["-t pattern", "--table= pattern"], "summary": "Check tables matching the specified pattern , unless they are otherwise excluded. This option can be specified more than once.", "signature": "-t pattern --table= pattern", "source_url": "/docs/devel/app-pgamcheck.html", "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", "--exclude-table= pattern"], "summary": "Exclude tables matching the specified pattern . This option can be specified more than once.", "signature": "-T pattern --exclude-table= pattern", "source_url": "/docs/devel/app-pgamcheck.html", "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": ["--no-dependent-indexes"], "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": "--no-dependent-indexes", "source_url": "/docs/devel/app-pgamcheck.html", "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-toast"], "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": "--no-dependent-toast", "source_url": "/docs/devel/app-pgamcheck.html", "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-strict-names"], "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": "--no-strict-names", "source_url": "/docs/devel/app-pgamcheck.html", "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": ["--exclude-toast-pointers"], "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": "--exclude-toast-pointers", "source_url": "/docs/devel/app-pgamcheck.html", "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": ["--on-error-stop"], "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": "--on-error-stop", "source_url": "/docs/devel/app-pgamcheck.html", "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": ["--skip= option"], "summary": "If all-frozen is given, table corruption checks will skip over pages in all tables that are marked as all frozen.", "signature": "--skip= option", "source_url": "/docs/devel/app-pgamcheck.html", "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": ["--startblock= block"], "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": "--startblock= block", "source_url": "/docs/devel/app-pgamcheck.html", "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": ["--endblock= block"], "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": "--endblock= block", "source_url": "/docs/devel/app-pgamcheck.html", "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": ["--checkunique"], "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": "--checkunique", "source_url": "/docs/devel/app-pgamcheck.html", "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": ["--heapallindexed"], "summary": "For each index checked, verify the presence of all heap tuples as index tuples in the index using amcheck 's heapallindexed option.", "signature": "--heapallindexed", "source_url": "/docs/devel/app-pgamcheck.html", "description": "For each index checked, verify the presence of all heap tuples as index tuples in the index using amcheck 's heapallindexed option."}, {"names": ["--parent-check"], "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": "--parent-check", "source_url": "/docs/devel/app-pgamcheck.html", "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": ["--rootdescend"], "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": "--rootdescend", "source_url": "/docs/devel/app-pgamcheck.html", "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": ["-h hostname", "--host= hostname"], "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": "-h hostname --host= hostname", "source_url": "/docs/devel/app-pgamcheck.html", "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": ["-p port", "--port= port"], "summary": "Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections.", "signature": "-p port --port= port", "source_url": "/docs/devel/app-pgamcheck.html", "description": "Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections."}, {"names": ["-U", "--username= username"], "summary": "User name to connect as.", "signature": "-U --username= username", "source_url": "/docs/devel/app-pgamcheck.html", "description": "User name to connect as."}, {"names": ["-w", "--no-password"], "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": "-w --no-password", "source_url": "/docs/devel/app-pgamcheck.html", "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", "--password"], "summary": "Force pg_amcheck to prompt for a password before connecting to a database.", "signature": "-W --password", "source_url": "/docs/devel/app-pgamcheck.html", "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": ["--maintenance-db= dbname"], "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": "--maintenance-db= dbname", "source_url": "/docs/devel/app-pgamcheck.html", "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": ["-e", "--echo"], "summary": "Echo to stdout all SQL sent to the server.", "signature": "-e --echo", "source_url": "/docs/devel/app-pgamcheck.html", "description": "Echo to stdout all SQL sent to the server."}, {"names": ["-j num", "--jobs= num"], "summary": "Use num concurrent connections to the server, or one per object to be checked, whichever is less.", "signature": "-j num --jobs= num", "source_url": "/docs/devel/app-pgamcheck.html", "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": ["-P", "--progress"], "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": "-P --progress", "source_url": "/docs/devel/app-pgamcheck.html", "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": ["-v", "--verbose"], "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": "-v --verbose", "source_url": "/docs/devel/app-pgamcheck.html", "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", "--version"], "summary": "Print the pg_amcheck version and exit.", "signature": "-V --version", "source_url": "/docs/devel/app-pgamcheck.html", "description": "Print the pg_amcheck version and exit."}, {"names": ["--install-missing", "--install-missing= schema"], "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": "--install-missing --install-missing= schema", "source_url": "/docs/devel/app-pgamcheck.html", "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": ["-?", "--help"], "summary": "Show help about pg_amcheck command line arguments, and exit.", "signature": "-? --help", "source_url": "/docs/devel/app-pgamcheck.html", "description": "Show help about pg_amcheck command line arguments, and exit."}], "related": [], "release": {"ref": "https://ftp.postgresql.org/pub/snapshot/dev/postgresql-snapshot.tar.bz2", "label": "20devel", "major": "20", "channel": "devel", "manifest": {"pdf": {"A4": {"url": "/files/documentation/pdf/20/postgresql-20-A4.pdf", "bytes": 16030631, "pages": 3052, "sha256": "bd5d82c0ce38fc18f92a0447818a91a193a261776bca1c37564bf9a683e177d0", "built_at": "2026-09-28"}, "US": {"url": "/files/documentation/pdf/20/postgresql-20-US.pdf", "bytes": 15936613, "pages": 3223, "sha256": "d97d9e0db479a02f4234b175f50fcad70c3661619afc8d6df9b9437882e3c299", "built_at": "2026-09-28"}}, "tree": "0", "index": "index.html", "major": "20", "pages": 1156, "release": "20devel", "source_url": "https://ftp.postgresql.org/pub/snapshot/dev/postgresql-snapshot.tar.bz2", "svg_assets": 6, "source_mode": "en SGML built with pinned official archive", "source_sha256": "4d3346909b201ac1648232cf290462a7070c119326f56196f1f0253ed80fae41", "source_snapshot_utc": "26-Sep-2026 20:22"}, "revision": "2eba5e0fd4c3bffb2803247b6cd537878e9d6ee5a6dfbe3c50ece8b421b80918", "evidence_kind": "English manual and source declarations", "source_sha256": "4d3346909b201ac1648232cf290462a7070c119326f56196f1f0253ed80fae41"}, "sources": [{"url": "/docs/devel/app-pgamcheck.html", "file": "app-pgamcheck.html", "label": "20devel English manual \u00b7 app-pgamcheck.html", "anchor": "", "sha256": "d0a3048d2f2b5bc6372d4cb4117e971acfd47db75ef5e8b990e670f1a34856de"}, {"url": "/docs/devel/reference-client.html", "file": "reference-client.html", "label": "Client applications inventory", "anchor": "", "sha256": "a6c7ba748fa1d9feac5bb7cde41d1d36a1f4c26d5963e07fb103d02918b2a8ca"}], "sections": [], "synopsis": ["pg_amcheck [ option ...] [ dbname ]"], "signature": "pg_amcheck [ option ...] [ dbname ]", "description": ["pg_amcheck \u2014 checks for corruption in one or more PostgreSQL databases"], "environment": [], "manual_html": "<div><div class=\"refentry\" id=\"APP-PGAMCHECK\">\n<div class=\"titlepage\"></div>\n<div class=\"refnamediv\">\n<h2><span class=\"refentrytitle\"><span class=\"application\">pg_amcheck</span></span></h2>\n<p>pg_amcheck \u2014 checks for corruption in one or more <span class=\"productname\">PostgreSQL</span> databases</p>\n</div>\n<div class=\"refsynopsisdiv\">\n<h2>Synopsis</h2>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.4.9.4.1\"><code class=\"command\">pg_amcheck</code> [<em class=\"replaceable\"><code>option</code></em>...] [<em class=\"replaceable\"><code>dbname</code></em>]</p>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.4.9.5\">\n<h2>Description</h2>\n<p><span class=\"application\">pg_amcheck</span> supports running <a class=\"xref\" href=\"/docs/devel/amcheck.html\" title=\"F.1.\u00a0amcheck \u2014 tools to verify table and index consistency\">amcheck</a>'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.</p>\n<p>Only ordinary and TOAST table relations, materialized views, sequences, and btree indexes are currently supported. Other relation types are silently skipped.</p>\n<p>If <code class=\"literal\">dbname</code> 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 <code class=\"option\">--all</code>, <code class=\"option\">--database</code> and <code class=\"option\">--exclude-database</code>. They also include <code class=\"option\">--relation</code>, <code class=\"option\">--exclude-relation</code>, <code class=\"option\">--table</code>, <code class=\"option\">--exclude-table</code>, <code class=\"option\">--index</code>, and <code class=\"option\">--exclude-index</code>, but only when such options are used with a three-part pattern (e.g. <code class=\"option\">mydb*.myschema*.myrel*</code>). Finally, they include <code class=\"option\">--schema</code> and <code class=\"option\">--exclude-schema</code> when such options are used with a two-part pattern (e.g. <code class=\"option\">mydb*.myschema*</code>).</p>\n<p><em class=\"replaceable\"><code>dbname</code></em> can also be a <a class=\"link\" href=\"/docs/devel/libpq-connect.html#LIBPQ-CONNSTRING\" title=\"32.1.1.\u00a0Connection Strings\">connection string</a>.</p>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.4.9.6\">\n<h2>Options</h2>\n<p>The following command-line options control what is checked:</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-a</code><br></span><span class=\"term\"><code class=\"option\">--all</code></span></dt>\n<dd>\n<p>Check all databases, except for any excluded via <code class=\"option\">--exclude-database</code>.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-d <em class=\"replaceable\"><code>pattern</code></em></code><br></span><span class=\"term\"><code class=\"option\">--database=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p>Check databases matching the specified <a class=\"link\" href=\"/docs/devel/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"><em class=\"replaceable\"><code>pattern</code></em></a>, except for any excluded by <code class=\"option\">--exclude-database</code>. This option can be specified more than once.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-D <em class=\"replaceable\"><code>pattern</code></em></code><br></span><span class=\"term\"><code class=\"option\">--exclude-database=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p>Exclude databases matching the given <a class=\"link\" href=\"/docs/devel/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"><em class=\"replaceable\"><code>pattern</code></em></a>. This option can be specified more than once.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-i <em class=\"replaceable\"><code>pattern</code></em></code><br></span><span class=\"term\"><code class=\"option\">--index=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p>Check indexes matching the specified <a class=\"link\" href=\"/docs/devel/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"><em class=\"replaceable\"><code>pattern</code></em></a>, unless they are otherwise excluded. This option can be specified more than once.</p>\n<p>This is similar to the <code class=\"option\">--relation</code> option, except that it applies only to indexes, not to other relation types.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-I <em class=\"replaceable\"><code>pattern</code></em></code><br></span><span class=\"term\"><code class=\"option\">--exclude-index=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p>Exclude indexes matching the specified <a class=\"link\" href=\"/docs/devel/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"><em class=\"replaceable\"><code>pattern</code></em></a>. This option can be specified more than once.</p>\n<p>This is similar to the <code class=\"option\">--exclude-relation</code> option, except that it applies only to indexes, not other relation types.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-r <em class=\"replaceable\"><code>pattern</code></em></code><br></span><span class=\"term\"><code class=\"option\">--relation=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p>Check relations matching the specified <a class=\"link\" href=\"/docs/devel/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"><em class=\"replaceable\"><code>pattern</code></em></a>, unless they are otherwise excluded. This option can be specified more than once.</p>\n<p>Patterns may be unqualified, e.g. <code class=\"literal\">myrel*</code>, or they may be schema-qualified, e.g. <code class=\"literal\">myschema*.myrel*</code> or database-qualified and schema-qualified, e.g. <code class=\"literal\">mydb*.myschema*.myrel*</code>. A database-qualified pattern will add matching databases to the list of databases to be checked.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-R <em class=\"replaceable\"><code>pattern</code></em></code><br></span><span class=\"term\"><code class=\"option\">--exclude-relation=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p>Exclude relations matching the specified <a class=\"link\" href=\"/docs/devel/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"><em class=\"replaceable\"><code>pattern</code></em></a>. This option can be specified more than once.</p>\n<p>As with <code class=\"option\">--relation</code>, the <a class=\"link\" href=\"/docs/devel/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"><em class=\"replaceable\"><code>pattern</code></em></a> may be unqualified, schema-qualified, or database- and schema-qualified.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-s <em class=\"replaceable\"><code>pattern</code></em></code><br></span><span class=\"term\"><code class=\"option\">--schema=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p>Check tables and indexes in schemas matching the specified <a class=\"link\" href=\"/docs/devel/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"><em class=\"replaceable\"><code>pattern</code></em></a>, unless they are otherwise excluded. This option can be specified more than once.</p>\n<p>To select only tables in schemas matching a particular pattern, consider using something like <code class=\"literal\">--table=SCHEMAPAT.* --no-dependent-indexes</code>. To select only indexes, consider using something like <code class=\"literal\">--index=SCHEMAPAT.*</code>.</p>\n<p>A schema pattern may be database-qualified. For example, you may write <code class=\"literal\">--schema=mydb*.myschema*</code> to select schemas matching <code class=\"literal\">myschema*</code> in databases matching <code class=\"literal\">mydb*</code>.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-S <em class=\"replaceable\"><code>pattern</code></em></code><br></span><span class=\"term\"><code class=\"option\">--exclude-schema=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p>Exclude tables and indexes in schemas matching the specified <a class=\"link\" href=\"/docs/devel/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"><em class=\"replaceable\"><code>pattern</code></em></a>. This option can be specified more than once.</p>\n<p>As with <code class=\"option\">--schema</code>, the pattern may be database-qualified.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-t <em class=\"replaceable\"><code>pattern</code></em></code><br></span><span class=\"term\"><code class=\"option\">--table=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p>Check tables matching the specified <a class=\"link\" href=\"/docs/devel/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"><em class=\"replaceable\"><code>pattern</code></em></a>, unless they are otherwise excluded. This option can be specified more than once.</p>\n<p>This is similar to the <code class=\"option\">--relation</code> option, except that it applies only to tables, materialized views, and sequences, not to indexes.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-T <em class=\"replaceable\"><code>pattern</code></em></code><br></span><span class=\"term\"><code class=\"option\">--exclude-table=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p>Exclude tables matching the specified <a class=\"link\" href=\"/docs/devel/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"><em class=\"replaceable\"><code>pattern</code></em></a>. This option can be specified more than once.</p>\n<p>This is similar to the <code class=\"option\">--exclude-relation</code> option, except that it applies only to tables, materialized views, and sequences, not to indexes.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-dependent-indexes</code></span></dt>\n<dd>\n<p>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 <code class=\"literal\">--index</code> or <code class=\"literal\">--relation</code>. This option suppresses that behavior.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-dependent-toast</code></span></dt>\n<dd>\n<p>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 <code class=\"literal\">--table</code> or <code class=\"literal\">--relation</code>. This option suppresses that behavior.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-strict-names</code></span></dt>\n<dd>\n<p>By default, if an argument to <code class=\"literal\">--database</code>, <code class=\"literal\">--table</code>, <code class=\"literal\">--index</code>, or <code class=\"literal\">--relation</code> matches no objects, it is a fatal error. This option downgrades that error to a warning.</p>\n</dd>\n</dl>\n</div>\n<p>The following command-line options control checking of tables:</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">--exclude-toast-pointers</code></span></dt>\n<dd>\n<p>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.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--on-error-stop</code></span></dt>\n<dd>\n<p>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.</p>\n<p>Note that index checking always stops after the first corrupt page. This option only has meaning relative to table relations.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--skip=<em class=\"replaceable\"><code>option</code></em></code></span></dt>\n<dd>\n<p>If <code class=\"literal\">all-frozen</code> is given, table corruption checks will skip over pages in all tables that are marked as all frozen.</p>\n<p>If <code class=\"literal\">all-visible</code> is given, table corruption checks will skip over pages in all tables that are marked as all visible.</p>\n<p>By default, no pages are skipped. This can be specified as <code class=\"literal\">none</code>, but since this is the default, it need not be mentioned.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--startblock=<em class=\"replaceable\"><code>block</code></em></code></span></dt>\n<dd>\n<p>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 <code class=\"literal\">--endblock</code> for further caveats.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--endblock=<em class=\"replaceable\"><code>block</code></em></code></span></dt>\n<dd>\n<p>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 <code class=\"option\">--exclude-toast-pointers</code>.</p>\n</dd>\n</dl>\n</div>\n<p>The following command-line options control checking of B-tree indexes:</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">--checkunique</code></span></dt>\n<dd>\n<p>For each index with unique constraint checked, verify that no more than one among duplicate entries is visible in the index using <a class=\"xref\" href=\"/docs/devel/amcheck.html\" title=\"F.1.\u00a0amcheck \u2014 tools to verify table and index consistency\">amcheck</a>'s <code class=\"option\">checkunique</code> option.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--heapallindexed</code></span></dt>\n<dd>\n<p>For each index checked, verify the presence of all heap tuples as index tuples in the index using <a class=\"xref\" href=\"/docs/devel/amcheck.html\" title=\"F.1.\u00a0amcheck \u2014 tools to verify table and index consistency\">amcheck</a>'s <code class=\"option\">heapallindexed</code> option.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--parent-check</code></span></dt>\n<dd>\n<p>For each btree index checked, use <a class=\"xref\" href=\"/docs/devel/amcheck.html\" title=\"F.1.\u00a0amcheck \u2014 tools to verify table and index consistency\">amcheck</a>'s <code class=\"function\">bt_index_parent_check</code> function, which performs additional checks of parent/child relationships during index checking.</p>\n<p>The default is to use <span class=\"application\">amcheck</span>'s <code class=\"function\">bt_index_check</code> function, but note that use of the <code class=\"option\">--rootdescend</code> option implicitly selects <code class=\"function\">bt_index_parent_check</code>.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--rootdescend</code></span></dt>\n<dd>\n<p>For each index checked, re-find tuples on the leaf level by performing a new search from the root page for each tuple using <a class=\"xref\" href=\"/docs/devel/amcheck.html\" title=\"F.1.\u00a0amcheck \u2014 tools to verify table and index consistency\">amcheck</a>'s <code class=\"option\">rootdescend</code> option.</p>\n<p>Use of this option implicitly also selects the <code class=\"option\">--parent-check</code> option.</p>\n<p>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.</p>\n</dd>\n</dl>\n</div>\n<div class=\"warning\">\n<h3 class=\"title\">Warning</h3>\n<p>The extra checks performed against B-tree indexes when the <code class=\"option\">--parent-check</code> option or the <code class=\"option\">--rootdescend</code> option is specified require relatively strong relation-level locks. These checks are the only checks that will block concurrent data modification from <code class=\"command\">INSERT</code>, <code class=\"command\">UPDATE</code>, and <code class=\"command\">DELETE</code> commands.</p>\n</div>\n<p>The following command-line options control the connection to the server:</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-h <em class=\"replaceable\"><code>hostname</code></em></code><br></span><span class=\"term\"><code class=\"option\">--host=<em class=\"replaceable\"><code>hostname</code></em></code></span></dt>\n<dd>\n<p>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.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-p <em class=\"replaceable\"><code>port</code></em></code><br></span><span class=\"term\"><code class=\"option\">--port=<em class=\"replaceable\"><code>port</code></em></code></span></dt>\n<dd>\n<p>Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-U</code><br></span><span class=\"term\"><code class=\"option\">--username=<em class=\"replaceable\"><code>username</code></em></code></span></dt>\n<dd>\n<p>User name to connect as.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-w</code><br></span><span class=\"term\"><code class=\"option\">--no-password</code></span></dt>\n<dd>\n<p>Never issue a password prompt. If the server requires password authentication and a password is not available by other means such as a <code class=\"filename\">.pgpass</code> 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.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-W</code><br></span><span class=\"term\"><code class=\"option\">--password</code></span></dt>\n<dd>\n<p>Force <span class=\"application\">pg_amcheck</span> to prompt for a password before connecting to a database.</p>\n<p>This option is never essential, since <span class=\"application\">pg_amcheck</span> will automatically prompt for a password if the server demands password authentication. However, <span class=\"application\">pg_amcheck</span> will waste a connection attempt finding out that the server wants a password. In some cases it is worth typing <code class=\"option\">-W</code> to avoid the extra connection attempt.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--maintenance-db=<em class=\"replaceable\"><code>dbname</code></em></code></span></dt>\n<dd>\n<p>Specifies a database or <a class=\"link\" href=\"/docs/devel/libpq-connect.html#LIBPQ-CONNSTRING\" title=\"32.1.1.\u00a0Connection Strings\">connection string</a> to be used to discover the list of databases to be checked. If neither <code class=\"option\">--all</code> 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 <code class=\"literal\">postgres</code> or, if that fails, <code class=\"literal\">template1</code>.</p>\n</dd>\n</dl>\n</div>\n<p>Other options are also available:</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-e</code><br></span><span class=\"term\"><code class=\"option\">--echo</code></span></dt>\n<dd>\n<p>Echo to stdout all SQL sent to the server.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-j <em class=\"replaceable\"><code>num</code></em></code><br></span><span class=\"term\"><code class=\"option\">--jobs=<em class=\"replaceable\"><code>num</code></em></code></span></dt>\n<dd>\n<p>Use <em class=\"replaceable\"><code>num</code></em> concurrent connections to the server, or one per object to be checked, whichever is less.</p>\n<p>The default is to use a single connection.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-P</code><br></span><span class=\"term\"><code class=\"option\">--progress</code></span></dt>\n<dd>\n<p>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.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-v</code><br></span><span class=\"term\"><code class=\"option\">--verbose</code></span></dt>\n<dd>\n<p>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.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-V</code><br></span><span class=\"term\"><code class=\"option\">--version</code></span></dt>\n<dd>\n<p>Print the <span class=\"application\">pg_amcheck</span> version and exit.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--install-missing</code><br></span><span class=\"term\"><code class=\"option\">--install-missing=<em class=\"replaceable\"><code>schema</code></em></code></span></dt>\n<dd>\n<p>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 <em class=\"replaceable\"><code>schema</code></em>, or if not specified into schema <code class=\"literal\">pg_catalog</code>.</p>\n<p>At present, the only required extension is <a class=\"xref\" href=\"/docs/devel/amcheck.html\" title=\"F.1.\u00a0amcheck \u2014 tools to verify table and index consistency\">amcheck</a>.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-?</code><br></span><span class=\"term\"><code class=\"option\">--help</code></span></dt>\n<dd>\n<p>Show help about <span class=\"application\">pg_amcheck</span> command line arguments, and exit.</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.4.9.7\">\n<h2>Environment</h2>\n<p><code class=\"command\">pg_amcheck</code>, like most other <span class=\"productname\">PostgreSQL</span> utilities, also uses the environment variables supported by <span class=\"application\">libpq</span> (see <a class=\"xref\" href=\"/docs/devel/libpq-envars.html\" title=\"32.14.\u00a0Environment Variables\">Section\u00a032.14</a>).</p>\n<p>The environment variable <code class=\"envar\">PG_COLOR</code> specifies whether to use color in diagnostic messages. Possible values are <code class=\"literal\">always</code>, <code class=\"literal\">auto</code> and <code class=\"literal\">never</code>.</p>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.4.9.8\">\n<h2>Notes</h2>\n<p><span class=\"application\">pg_amcheck</span> is designed to work with <span class=\"productname\">PostgreSQL</span> 14.0 and later.</p>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.4.9.9\">\n<h2>See Also</h2><span class=\"simplelist\"><a class=\"xref\" href=\"/docs/devel/amcheck.html\" title=\"F.1.\u00a0amcheck \u2014 tools to verify table and index consistency\">amcheck</a></span>\n</div>\n</div></div>", "manual_path": "app-pgamcheck.html", "comparison_data": {"options": [{"names": ["-a", "--all"], "signature": "-a --all", "description": "Check all databases, except for any excluded via --exclude-database ."}, {"names": ["-d pattern", "--database= pattern"], "signature": "-d pattern --database= pattern", "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", "--exclude-database= pattern"], "signature": "-D pattern --exclude-database= pattern", "description": "Exclude databases matching the given pattern . This option can be specified more than once."}, {"names": ["-i pattern", "--index= pattern"], "signature": "-i pattern --index= 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", "--exclude-index= pattern"], "signature": "-I pattern --exclude-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": ["-r pattern", "--relation= pattern"], "signature": "-r pattern --relation= 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", "--exclude-relation= pattern"], "signature": "-R pattern --exclude-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": ["-s pattern", "--schema= pattern"], "signature": "-s pattern --schema= 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", "--exclude-schema= pattern"], "signature": "-S pattern --exclude-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": ["-t pattern", "--table= pattern"], "signature": "-t pattern --table= 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", "--exclude-table= pattern"], "signature": "-T pattern --exclude-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": ["--no-dependent-indexes"], "signature": "--no-dependent-indexes", "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-toast"], "signature": "--no-dependent-toast", "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-strict-names"], "signature": "--no-strict-names", "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": ["--exclude-toast-pointers"], "signature": "--exclude-toast-pointers", "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": ["--on-error-stop"], "signature": "--on-error-stop", "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": ["--skip= option"], "signature": "--skip= option", "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": ["--startblock= block"], "signature": "--startblock= block", "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": ["--endblock= block"], "signature": "--endblock= 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": ["--checkunique"], "signature": "--checkunique", "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": ["--heapallindexed"], "signature": "--heapallindexed", "description": "For each index checked, verify the presence of all heap tuples as index tuples in the index using amcheck 's heapallindexed option."}, {"names": ["--parent-check"], "signature": "--parent-check", "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": ["--rootdescend"], "signature": "--rootdescend", "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": ["-h hostname", "--host= hostname"], "signature": "-h hostname --host= hostname", "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": ["-p port", "--port= port"], "signature": "-p port --port= port", "description": "Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections."}, {"names": ["-U", "--username= username"], "signature": "-U --username= username", "description": "User name to connect as."}, {"names": ["-w", "--no-password"], "signature": "-w --no-password", "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", "--password"], "signature": "-W --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": ["--maintenance-db= dbname"], "signature": "--maintenance-db= dbname", "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": ["-e", "--echo"], "signature": "-e --echo", "description": "Echo to stdout all SQL sent to the server."}, {"names": ["-j num", "--jobs= num"], "signature": "-j num --jobs= num", "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": ["-P", "--progress"], "signature": "-P --progress", "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": ["-v", "--verbose"], "signature": "-v --verbose", "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", "--version"], "signature": "-V --version", "description": "Print the pg_amcheck version and exit."}, {"names": ["--install-missing", "--install-missing= schema"], "signature": "--install-missing --install-missing= schema", "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": ["-?", "--help"], "signature": "-? --help", "description": "Show help about pg_amcheck command line arguments, and exit."}], "synopsis": ["pg_amcheck [ option ...] [ dbname ]"], "environment": []}, "comparison_hash": "1b5d8dc89b45637c0e8cd1b5f25a6ec2793afeadec9edeae24cdb512794aa018"}}}, "snapshot": {"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"}], "tables": [{"key": "options", "rows": [{"summary": "Check all databases, except for any excluded via --exclude-database .", "signature": {"url": "/docs/18/app-pgamcheck.html", "text": "-a --all"}}, {"summary": "Check databases matching the specified pattern , except for any excluded by --exclude-database . This option can be specified more than once.", "signature": {"url": "/docs/18/app-pgamcheck.html", "text": "-d pattern --database= pattern"}}, {"summary": "Exclude databases matching the given pattern . This option can be specified more than once.", "signature": {"url": "/docs/18/app-pgamcheck.html", "text": "-D pattern --exclude-database= pattern"}}, {"summary": "Check indexes matching the specified pattern , unless they are otherwise excluded. This option can be specified more than once.", "signature": {"url": "/docs/18/app-pgamcheck.html", "text": "-i pattern --index= pattern"}}, {"summary": "Exclude indexes matching the specified pattern . This option can be specified more than once.", "signature": {"url": "/docs/18/app-pgamcheck.html", "text": "-I pattern --exclude-index= pattern"}}, {"summary": "Check relations matching the specified pattern , unless they are otherwise excluded. This option can be specified more than once.", "signature": {"url": "/docs/18/app-pgamcheck.html", "text": "-r pattern --relation= pattern"}}, {"summary": "Exclude relations matching the specified pattern . This option can be specified more than once.", "signature": {"url": "/docs/18/app-pgamcheck.html", "text": "-R pattern --exclude-relation= pattern"}}, {"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": {"url": "/docs/18/app-pgamcheck.html", "text": "-s pattern --schema= pattern"}}, {"summary": "Exclude tables and indexes in schemas matching the specified pattern . This option can be specified more than once.", "signature": {"url": "/docs/18/app-pgamcheck.html", "text": "-S pattern --exclude-schema= pattern"}}, {"summary": "Check tables matching the specified pattern , unless they are otherwise excluded. This option can be specified more than once.", "signature": {"url": "/docs/18/app-pgamcheck.html", "text": "-t pattern --table= pattern"}}, {"summary": "Exclude tables matching the specified pattern . This option can be specified more than once.", "signature": {"url": "/docs/18/app-pgamcheck.html", "text": "-T pattern --exclude-table= pattern"}}, {"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": {"url": "/docs/18/app-pgamcheck.html", "text": "--no-dependent-indexes"}}, {"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": {"url": "/docs/18/app-pgamcheck.html", "text": "--no-dependent-toast"}}, {"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": {"url": "/docs/18/app-pgamcheck.html", "text": "--no-strict-names"}}, {"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": {"url": "/docs/18/app-pgamcheck.html", "text": "--exclude-toast-pointers"}}, {"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": {"url": "/docs/18/app-pgamcheck.html", "text": "--on-error-stop"}}, {"summary": "If all-frozen is given, table corruption checks will skip over pages in all tables that are marked as all frozen.", "signature": {"url": "/docs/18/app-pgamcheck.html", "text": "--skip= option"}}, {"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": {"url": "/docs/18/app-pgamcheck.html", "text": "--startblock= block"}}, {"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": {"url": "/docs/18/app-pgamcheck.html", "text": "--endblock= block"}}, {"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": {"url": "/docs/18/app-pgamcheck.html", "text": "--checkunique"}}, {"summary": "For each index checked, verify the presence of all heap tuples as index tuples in the index using amcheck 's heapallindexed option.", "signature": {"url": "/docs/18/app-pgamcheck.html", "text": "--heapallindexed"}}, {"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": {"url": "/docs/18/app-pgamcheck.html", "text": "--parent-check"}}, {"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": {"url": "/docs/18/app-pgamcheck.html", "text": "--rootdescend"}}, {"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": {"url": "/docs/18/app-pgamcheck.html", "text": "-h hostname --host= hostname"}}, {"summary": "Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections.", "signature": {"url": "/docs/18/app-pgamcheck.html", "text": "-p port --port= port"}}, {"summary": "User name to connect as.", "signature": {"url": "/docs/18/app-pgamcheck.html", "text": "-U --username= username"}}, {"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": {"url": "/docs/18/app-pgamcheck.html", "text": "-w --no-password"}}, {"summary": "Force pg_amcheck to prompt for a password before connecting to a database.", "signature": {"url": "/docs/18/app-pgamcheck.html", "text": "-W --password"}}, {"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": {"url": "/docs/18/app-pgamcheck.html", "text": "--maintenance-db= dbname"}}, {"summary": "Echo to stdout all SQL sent to the server.", "signature": {"url": "/docs/18/app-pgamcheck.html", "text": "-e --echo"}}, {"summary": "Use num concurrent connections to the server, or one per object to be checked, whichever is less.", "signature": {"url": "/docs/18/app-pgamcheck.html", "text": "-j num --jobs= num"}}, {"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": {"url": "/docs/18/app-pgamcheck.html", "text": "-P --progress"}}, {"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": {"url": "/docs/18/app-pgamcheck.html", "text": "-v --verbose"}}, {"summary": "Print the pg_amcheck version and exit.", "signature": {"url": "/docs/18/app-pgamcheck.html", "text": "-V --version"}}, {"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": {"url": "/docs/18/app-pgamcheck.html", "text": "--install-missing --install-missing= schema"}}, {"summary": "Show help about pg_amcheck command line arguments, and exit.", "signature": {"url": "/docs/18/app-pgamcheck.html", "text": "-? --help"}}], "title": "Documented options", "columns": [{"key": "signature", "label": "Option and arguments"}, {"key": "summary", "label": "Description"}]}], "options": [{"names": ["-a", "--all"], "summary": "Check all databases, except for any excluded via --exclude-database .", "signature": "-a --all", "source_url": "/docs/18/app-pgamcheck.html", "description": "Check all databases, except for any excluded via --exclude-database ."}, {"names": ["-d pattern", "--database= pattern"], "summary": "Check databases matching the specified pattern , except for any excluded by --exclude-database . This option can be specified more than once.", "signature": "-d pattern --database= pattern", "source_url": "/docs/18/app-pgamcheck.html", "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", "--exclude-database= pattern"], "summary": "Exclude databases matching the given pattern . This option can be specified more than once.", "signature": "-D pattern --exclude-database= pattern", "source_url": "/docs/18/app-pgamcheck.html", "description": "Exclude databases matching the given pattern . This option can be specified more than once."}, {"names": ["-i pattern", "--index= pattern"], "summary": "Check indexes matching the specified pattern , unless they are otherwise excluded. This option can be specified more than once.", "signature": "-i pattern --index= pattern", "source_url": "/docs/18/app-pgamcheck.html", "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", "--exclude-index= pattern"], "summary": "Exclude indexes matching the specified pattern . This option can be specified more than once.", "signature": "-I pattern --exclude-index= pattern", "source_url": "/docs/18/app-pgamcheck.html", "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": ["-r pattern", "--relation= pattern"], "summary": "Check relations matching the specified pattern , unless they are otherwise excluded. This option can be specified more than once.", "signature": "-r pattern --relation= pattern", "source_url": "/docs/18/app-pgamcheck.html", "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", "--exclude-relation= pattern"], "summary": "Exclude relations matching the specified pattern . This option can be specified more than once.", "signature": "-R pattern --exclude-relation= pattern", "source_url": "/docs/18/app-pgamcheck.html", "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": ["-s pattern", "--schema= pattern"], "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": "-s pattern --schema= pattern", "source_url": "/docs/18/app-pgamcheck.html", "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", "--exclude-schema= pattern"], "summary": "Exclude tables and indexes in schemas matching the specified pattern . This option can be specified more than once.", "signature": "-S pattern --exclude-schema= pattern", "source_url": "/docs/18/app-pgamcheck.html", "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": ["-t pattern", "--table= pattern"], "summary": "Check tables matching the specified pattern , unless they are otherwise excluded. This option can be specified more than once.", "signature": "-t pattern --table= pattern", "source_url": "/docs/18/app-pgamcheck.html", "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", "--exclude-table= pattern"], "summary": "Exclude tables matching the specified pattern . This option can be specified more than once.", "signature": "-T pattern --exclude-table= pattern", "source_url": "/docs/18/app-pgamcheck.html", "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": ["--no-dependent-indexes"], "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": "--no-dependent-indexes", "source_url": "/docs/18/app-pgamcheck.html", "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-toast"], "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": "--no-dependent-toast", "source_url": "/docs/18/app-pgamcheck.html", "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-strict-names"], "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": "--no-strict-names", "source_url": "/docs/18/app-pgamcheck.html", "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": ["--exclude-toast-pointers"], "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": "--exclude-toast-pointers", "source_url": "/docs/18/app-pgamcheck.html", "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": ["--on-error-stop"], "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": "--on-error-stop", "source_url": "/docs/18/app-pgamcheck.html", "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": ["--skip= option"], "summary": "If all-frozen is given, table corruption checks will skip over pages in all tables that are marked as all frozen.", "signature": "--skip= option", "source_url": "/docs/18/app-pgamcheck.html", "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": ["--startblock= block"], "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": "--startblock= block", "source_url": "/docs/18/app-pgamcheck.html", "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": ["--endblock= block"], "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": "--endblock= block", "source_url": "/docs/18/app-pgamcheck.html", "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": ["--checkunique"], "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": "--checkunique", "source_url": "/docs/18/app-pgamcheck.html", "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": ["--heapallindexed"], "summary": "For each index checked, verify the presence of all heap tuples as index tuples in the index using amcheck 's heapallindexed option.", "signature": "--heapallindexed", "source_url": "/docs/18/app-pgamcheck.html", "description": "For each index checked, verify the presence of all heap tuples as index tuples in the index using amcheck 's heapallindexed option."}, {"names": ["--parent-check"], "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": "--parent-check", "source_url": "/docs/18/app-pgamcheck.html", "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": ["--rootdescend"], "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": "--rootdescend", "source_url": "/docs/18/app-pgamcheck.html", "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": ["-h hostname", "--host= hostname"], "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": "-h hostname --host= hostname", "source_url": "/docs/18/app-pgamcheck.html", "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": ["-p port", "--port= port"], "summary": "Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections.", "signature": "-p port --port= port", "source_url": "/docs/18/app-pgamcheck.html", "description": "Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections."}, {"names": ["-U", "--username= username"], "summary": "User name to connect as.", "signature": "-U --username= username", "source_url": "/docs/18/app-pgamcheck.html", "description": "User name to connect as."}, {"names": ["-w", "--no-password"], "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": "-w --no-password", "source_url": "/docs/18/app-pgamcheck.html", "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", "--password"], "summary": "Force pg_amcheck to prompt for a password before connecting to a database.", "signature": "-W --password", "source_url": "/docs/18/app-pgamcheck.html", "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": ["--maintenance-db= dbname"], "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": "--maintenance-db= dbname", "source_url": "/docs/18/app-pgamcheck.html", "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": ["-e", "--echo"], "summary": "Echo to stdout all SQL sent to the server.", "signature": "-e --echo", "source_url": "/docs/18/app-pgamcheck.html", "description": "Echo to stdout all SQL sent to the server."}, {"names": ["-j num", "--jobs= num"], "summary": "Use num concurrent connections to the server, or one per object to be checked, whichever is less.", "signature": "-j num --jobs= num", "source_url": "/docs/18/app-pgamcheck.html", "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": ["-P", "--progress"], "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": "-P --progress", "source_url": "/docs/18/app-pgamcheck.html", "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": ["-v", "--verbose"], "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": "-v --verbose", "source_url": "/docs/18/app-pgamcheck.html", "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", "--version"], "summary": "Print the pg_amcheck version and exit.", "signature": "-V --version", "source_url": "/docs/18/app-pgamcheck.html", "description": "Print the pg_amcheck version and exit."}, {"names": ["--install-missing", "--install-missing= schema"], "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": "--install-missing --install-missing= schema", "source_url": "/docs/18/app-pgamcheck.html", "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": ["-?", "--help"], "summary": "Show help about pg_amcheck command line arguments, and exit.", "signature": "-? --help", "source_url": "/docs/18/app-pgamcheck.html", "description": "Show help about pg_amcheck command line arguments, and exit."}], "related": [], "release": {"ref": "https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2", "label": "18.6", "major": "18", "channel": "stable", "manifest": {"pdf": {"A4": {"url": "/files/documentation/pdf/18/postgresql-18-A4.pdf", "bytes": 15865106, "pages": 3154, "sha256": "19512c405da53f9f7fcf0abba359223aa65f021be025bf3411381918f92e3190", "built_at": "2026-09-26"}, "US": {"url": "/files/documentation/pdf/18/postgresql-18-US.pdf", "bytes": 15748059, "pages": 3328, "sha256": "facbe6c229e598b872d3d98bef53308f46e06746006fa4590de9a7de9dd46319", "built_at": "2026-09-26"}}, "tree": "18", "index": "index.html", "major": "18", "pages": 1148, "release": "18.6", "source_url": "https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2", "svg_assets": 3, "source_mode": "en SGML built with pinned official archive", "source_sha256": "555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f"}, "revision": "ee8d1a3612338fd9adf250730cb640fcc5233b5491337cc00a316a44e3a0b9f8", "evidence_kind": "English manual and source declarations", "source_sha256": "555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f"}, "sources": [{"url": "/docs/18/app-pgamcheck.html", "file": "app-pgamcheck.html", "label": "18.6 English manual \u00b7 app-pgamcheck.html", "anchor": "", "sha256": "e27a4203de24586f422047021fddd4cd69bbe0093c3949ac283091329050c9f5"}, {"url": "/docs/18/reference-client.html", "file": "reference-client.html", "label": "Client applications inventory", "anchor": "", "sha256": "68f726af77272fe73a827be2b7b5958d0f2239a6f8ed44264e9d42496bfa4fd0"}], "sections": [], "synopsis": ["pg_amcheck [ option ...] [ dbname ]"], "signature": "pg_amcheck [ option ...] [ dbname ]", "description": ["pg_amcheck \u2014 checks for corruption in one or more PostgreSQL databases"], "environment": [], "manual_html": "<div><div class=\"refentry\" id=\"APP-PGAMCHECK\">\n<div class=\"titlepage\"></div>\n<div class=\"refnamediv\">\n<h2><span class=\"refentrytitle\"><span class=\"application\">pg_amcheck</span></span></h2>\n<p>pg_amcheck \u2014 checks for corruption in one or more <span class=\"productname\">PostgreSQL</span> databases</p>\n</div>\n<div class=\"refsynopsisdiv\">\n<h2>Synopsis</h2>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.4.9.4.1\"><code class=\"command\">pg_amcheck</code> [<em class=\"replaceable\"><code>option</code></em>...] [<em class=\"replaceable\"><code>dbname</code></em>]</p>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.4.9.5\">\n<h2>Description</h2>\n<p><span class=\"application\">pg_amcheck</span> supports running <a class=\"xref\" href=\"/docs/18/amcheck.html\" title=\"F.1.\u00a0amcheck \u2014 tools to verify table and index consistency\">amcheck</a>'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.</p>\n<p>Only ordinary and toast table relations, materialized views, sequences, and btree indexes are currently supported. Other relation types are silently skipped.</p>\n<p>If <code class=\"literal\">dbname</code> 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 <code class=\"option\">--all</code>, <code class=\"option\">--database</code> and <code class=\"option\">--exclude-database</code>. They also include <code class=\"option\">--relation</code>, <code class=\"option\">--exclude-relation</code>, <code class=\"option\">--table</code>, <code class=\"option\">--exclude-table</code>, <code class=\"option\">--index</code>, and <code class=\"option\">--exclude-index</code>, but only when such options are used with a three-part pattern (e.g. <code class=\"option\">mydb*.myschema*.myrel*</code>). Finally, they include <code class=\"option\">--schema</code> and <code class=\"option\">--exclude-schema</code> when such options are used with a two-part pattern (e.g. <code class=\"option\">mydb*.myschema*</code>).</p>\n<p><em class=\"replaceable\"><code>dbname</code></em> can also be a <a class=\"link\" href=\"/docs/18/libpq-connect.html#LIBPQ-CONNSTRING\" title=\"32.1.1.\u00a0Connection Strings\">connection string</a>.</p>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.4.9.6\">\n<h2>Options</h2>\n<p>The following command-line options control what is checked:</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-a</code><br></span><span class=\"term\"><code class=\"option\">--all</code></span></dt>\n<dd>\n<p>Check all databases, except for any excluded via <code class=\"option\">--exclude-database</code>.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-d <em class=\"replaceable\"><code>pattern</code></em></code><br></span><span class=\"term\"><code class=\"option\">--database=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p>Check databases matching the specified <a class=\"link\" href=\"/docs/18/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"><em class=\"replaceable\"><code>pattern</code></em></a>, except for any excluded by <code class=\"option\">--exclude-database</code>. This option can be specified more than once.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-D <em class=\"replaceable\"><code>pattern</code></em></code><br></span><span class=\"term\"><code class=\"option\">--exclude-database=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p>Exclude databases matching the given <a class=\"link\" href=\"/docs/18/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"><em class=\"replaceable\"><code>pattern</code></em></a>. This option can be specified more than once.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-i <em class=\"replaceable\"><code>pattern</code></em></code><br></span><span class=\"term\"><code class=\"option\">--index=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p>Check indexes matching the specified <a class=\"link\" href=\"/docs/18/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"><em class=\"replaceable\"><code>pattern</code></em></a>, unless they are otherwise excluded. This option can be specified more than once.</p>\n<p>This is similar to the <code class=\"option\">--relation</code> option, except that it applies only to indexes, not to other relation types.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-I <em class=\"replaceable\"><code>pattern</code></em></code><br></span><span class=\"term\"><code class=\"option\">--exclude-index=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p>Exclude indexes matching the specified <a class=\"link\" href=\"/docs/18/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"><em class=\"replaceable\"><code>pattern</code></em></a>. This option can be specified more than once.</p>\n<p>This is similar to the <code class=\"option\">--exclude-relation</code> option, except that it applies only to indexes, not other relation types.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-r <em class=\"replaceable\"><code>pattern</code></em></code><br></span><span class=\"term\"><code class=\"option\">--relation=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p>Check relations matching the specified <a class=\"link\" href=\"/docs/18/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"><em class=\"replaceable\"><code>pattern</code></em></a>, unless they are otherwise excluded. This option can be specified more than once.</p>\n<p>Patterns may be unqualified, e.g. <code class=\"literal\">myrel*</code>, or they may be schema-qualified, e.g. <code class=\"literal\">myschema*.myrel*</code> or database-qualified and schema-qualified, e.g. <code class=\"literal\">mydb*.myschema*.myrel*</code>. A database-qualified pattern will add matching databases to the list of databases to be checked.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-R <em class=\"replaceable\"><code>pattern</code></em></code><br></span><span class=\"term\"><code class=\"option\">--exclude-relation=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p>Exclude relations matching the specified <a class=\"link\" href=\"/docs/18/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"><em class=\"replaceable\"><code>pattern</code></em></a>. This option can be specified more than once.</p>\n<p>As with <code class=\"option\">--relation</code>, the <a class=\"link\" href=\"/docs/18/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"><em class=\"replaceable\"><code>pattern</code></em></a> may be unqualified, schema-qualified, or database- and schema-qualified.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-s <em class=\"replaceable\"><code>pattern</code></em></code><br></span><span class=\"term\"><code class=\"option\">--schema=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p>Check tables and indexes in schemas matching the specified <a class=\"link\" href=\"/docs/18/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"><em class=\"replaceable\"><code>pattern</code></em></a>, unless they are otherwise excluded. This option can be specified more than once.</p>\n<p>To select only tables in schemas matching a particular pattern, consider using something like <code class=\"literal\">--table=SCHEMAPAT.* --no-dependent-indexes</code>. To select only indexes, consider using something like <code class=\"literal\">--index=SCHEMAPAT.*</code>.</p>\n<p>A schema pattern may be database-qualified. For example, you may write <code class=\"literal\">--schema=mydb*.myschema*</code> to select schemas matching <code class=\"literal\">myschema*</code> in databases matching <code class=\"literal\">mydb*</code>.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-S <em class=\"replaceable\"><code>pattern</code></em></code><br></span><span class=\"term\"><code class=\"option\">--exclude-schema=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p>Exclude tables and indexes in schemas matching the specified <a class=\"link\" href=\"/docs/18/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"><em class=\"replaceable\"><code>pattern</code></em></a>. This option can be specified more than once.</p>\n<p>As with <code class=\"option\">--schema</code>, the pattern may be database-qualified.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-t <em class=\"replaceable\"><code>pattern</code></em></code><br></span><span class=\"term\"><code class=\"option\">--table=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p>Check tables matching the specified <a class=\"link\" href=\"/docs/18/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"><em class=\"replaceable\"><code>pattern</code></em></a>, unless they are otherwise excluded. This option can be specified more than once.</p>\n<p>This is similar to the <code class=\"option\">--relation</code> option, except that it applies only to tables, materialized views, and sequences, not to indexes.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-T <em class=\"replaceable\"><code>pattern</code></em></code><br></span><span class=\"term\"><code class=\"option\">--exclude-table=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p>Exclude tables matching the specified <a class=\"link\" href=\"/docs/18/app-psql.html#APP-PSQL-PATTERNS\" title=\"Patterns\"><em class=\"replaceable\"><code>pattern</code></em></a>. This option can be specified more than once.</p>\n<p>This is similar to the <code class=\"option\">--exclude-relation</code> option, except that it applies only to tables, materialized views, and sequences, not to indexes.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-dependent-indexes</code></span></dt>\n<dd>\n<p>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 <code class=\"literal\">--index</code> or <code class=\"literal\">--relation</code>. This option suppresses that behavior.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-dependent-toast</code></span></dt>\n<dd>\n<p>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 <code class=\"literal\">--table</code> or <code class=\"literal\">--relation</code>. This option suppresses that behavior.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-strict-names</code></span></dt>\n<dd>\n<p>By default, if an argument to <code class=\"literal\">--database</code>, <code class=\"literal\">--table</code>, <code class=\"literal\">--index</code>, or <code class=\"literal\">--relation</code> matches no objects, it is a fatal error. This option downgrades that error to a warning.</p>\n</dd>\n</dl>\n</div>\n<p>The following command-line options control checking of tables:</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">--exclude-toast-pointers</code></span></dt>\n<dd>\n<p>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.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--on-error-stop</code></span></dt>\n<dd>\n<p>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.</p>\n<p>Note that index checking always stops after the first corrupt page. This option only has meaning relative to table relations.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--skip=<em class=\"replaceable\"><code>option</code></em></code></span></dt>\n<dd>\n<p>If <code class=\"literal\">all-frozen</code> is given, table corruption checks will skip over pages in all tables that are marked as all frozen.</p>\n<p>If <code class=\"literal\">all-visible</code> is given, table corruption checks will skip over pages in all tables that are marked as all visible.</p>\n<p>By default, no pages are skipped. This can be specified as <code class=\"literal\">none</code>, but since this is the default, it need not be mentioned.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--startblock=<em class=\"replaceable\"><code>block</code></em></code></span></dt>\n<dd>\n<p>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 <code class=\"literal\">--endblock</code> for further caveats.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--endblock=<em class=\"replaceable\"><code>block</code></em></code></span></dt>\n<dd>\n<p>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 <code class=\"option\">--exclude-toast-pointers</code>.</p>\n</dd>\n</dl>\n</div>\n<p>The following command-line options control checking of B-tree indexes:</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">--checkunique</code></span></dt>\n<dd>\n<p>For each index with unique constraint checked, verify that no more than one among duplicate entries is visible in the index using <a class=\"xref\" href=\"/docs/18/amcheck.html\" title=\"F.1.\u00a0amcheck \u2014 tools to verify table and index consistency\">amcheck</a>'s <code class=\"option\">checkunique</code> option.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--heapallindexed</code></span></dt>\n<dd>\n<p>For each index checked, verify the presence of all heap tuples as index tuples in the index using <a class=\"xref\" href=\"/docs/18/amcheck.html\" title=\"F.1.\u00a0amcheck \u2014 tools to verify table and index consistency\">amcheck</a>'s <code class=\"option\">heapallindexed</code> option.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--parent-check</code></span></dt>\n<dd>\n<p>For each btree index checked, use <a class=\"xref\" href=\"/docs/18/amcheck.html\" title=\"F.1.\u00a0amcheck \u2014 tools to verify table and index consistency\">amcheck</a>'s <code class=\"function\">bt_index_parent_check</code> function, which performs additional checks of parent/child relationships during index checking.</p>\n<p>The default is to use <span class=\"application\">amcheck</span>'s <code class=\"function\">bt_index_check</code> function, but note that use of the <code class=\"option\">--rootdescend</code> option implicitly selects <code class=\"function\">bt_index_parent_check</code>.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--rootdescend</code></span></dt>\n<dd>\n<p>For each index checked, re-find tuples on the leaf level by performing a new search from the root page for each tuple using <a class=\"xref\" href=\"/docs/18/amcheck.html\" title=\"F.1.\u00a0amcheck \u2014 tools to verify table and index consistency\">amcheck</a>'s <code class=\"option\">rootdescend</code> option.</p>\n<p>Use of this option implicitly also selects the <code class=\"option\">--parent-check</code> option.</p>\n<p>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.</p>\n</dd>\n</dl>\n</div>\n<div class=\"warning\">\n<h3 class=\"title\">Warning</h3>\n<p>The extra checks performed against B-tree indexes when the <code class=\"option\">--parent-check</code> option or the <code class=\"option\">--rootdescend</code> option is specified require relatively strong relation-level locks. These checks are the only checks that will block concurrent data modification from <code class=\"command\">INSERT</code>, <code class=\"command\">UPDATE</code>, and <code class=\"command\">DELETE</code> commands.</p>\n</div>\n<p>The following command-line options control the connection to the server:</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-h <em class=\"replaceable\"><code>hostname</code></em></code><br></span><span class=\"term\"><code class=\"option\">--host=<em class=\"replaceable\"><code>hostname</code></em></code></span></dt>\n<dd>\n<p>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.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-p <em class=\"replaceable\"><code>port</code></em></code><br></span><span class=\"term\"><code class=\"option\">--port=<em class=\"replaceable\"><code>port</code></em></code></span></dt>\n<dd>\n<p>Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-U</code><br></span><span class=\"term\"><code class=\"option\">--username=<em class=\"replaceable\"><code>username</code></em></code></span></dt>\n<dd>\n<p>User name to connect as.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-w</code><br></span><span class=\"term\"><code class=\"option\">--no-password</code></span></dt>\n<dd>\n<p>Never issue a password prompt. If the server requires password authentication and a password is not available by other means such as a <code class=\"filename\">.pgpass</code> 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.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-W</code><br></span><span class=\"term\"><code class=\"option\">--password</code></span></dt>\n<dd>\n<p>Force <span class=\"application\">pg_amcheck</span> to prompt for a password before connecting to a database.</p>\n<p>This option is never essential, since <span class=\"application\">pg_amcheck</span> will automatically prompt for a password if the server demands password authentication. However, <span class=\"application\">pg_amcheck</span> will waste a connection attempt finding out that the server wants a password. In some cases it is worth typing <code class=\"option\">-W</code> to avoid the extra connection attempt.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--maintenance-db=<em class=\"replaceable\"><code>dbname</code></em></code></span></dt>\n<dd>\n<p>Specifies a database or <a class=\"link\" href=\"/docs/18/libpq-connect.html#LIBPQ-CONNSTRING\" title=\"32.1.1.\u00a0Connection Strings\">connection string</a> to be used to discover the list of databases to be checked. If neither <code class=\"option\">--all</code> 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 <code class=\"literal\">postgres</code> or, if that fails, <code class=\"literal\">template1</code>.</p>\n</dd>\n</dl>\n</div>\n<p>Other options are also available:</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-e</code><br></span><span class=\"term\"><code class=\"option\">--echo</code></span></dt>\n<dd>\n<p>Echo to stdout all SQL sent to the server.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-j <em class=\"replaceable\"><code>num</code></em></code><br></span><span class=\"term\"><code class=\"option\">--jobs=<em class=\"replaceable\"><code>num</code></em></code></span></dt>\n<dd>\n<p>Use <em class=\"replaceable\"><code>num</code></em> concurrent connections to the server, or one per object to be checked, whichever is less.</p>\n<p>The default is to use a single connection.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-P</code><br></span><span class=\"term\"><code class=\"option\">--progress</code></span></dt>\n<dd>\n<p>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.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-v</code><br></span><span class=\"term\"><code class=\"option\">--verbose</code></span></dt>\n<dd>\n<p>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.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-V</code><br></span><span class=\"term\"><code class=\"option\">--version</code></span></dt>\n<dd>\n<p>Print the <span class=\"application\">pg_amcheck</span> version and exit.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--install-missing</code><br></span><span class=\"term\"><code class=\"option\">--install-missing=<em class=\"replaceable\"><code>schema</code></em></code></span></dt>\n<dd>\n<p>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 <em class=\"replaceable\"><code>schema</code></em>, or if not specified into schema <code class=\"literal\">pg_catalog</code>.</p>\n<p>At present, the only required extension is <a class=\"xref\" href=\"/docs/18/amcheck.html\" title=\"F.1.\u00a0amcheck \u2014 tools to verify table and index consistency\">amcheck</a>.</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-?</code><br></span><span class=\"term\"><code class=\"option\">--help</code></span></dt>\n<dd>\n<p>Show help about <span class=\"application\">pg_amcheck</span> command line arguments, and exit.</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.4.9.7\">\n<h2>Environment</h2>\n<p><code class=\"command\">pg_amcheck</code>, like most other <span class=\"productname\">PostgreSQL</span> utilities, also uses the environment variables supported by <span class=\"application\">libpq</span> (see <a class=\"xref\" href=\"/docs/18/libpq-envars.html\" title=\"32.15.\u00a0Environment Variables\">Section\u00a032.15</a>).</p>\n<p>The environment variable <code class=\"envar\">PG_COLOR</code> specifies whether to use color in diagnostic messages. Possible values are <code class=\"literal\">always</code>, <code class=\"literal\">auto</code> and <code class=\"literal\">never</code>.</p>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.4.9.8\">\n<h2>Notes</h2>\n<p><span class=\"application\">pg_amcheck</span> is designed to work with <span class=\"productname\">PostgreSQL</span> 14.0 and later.</p>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.4.9.9\">\n<h2>See Also</h2><span class=\"simplelist\"><a class=\"xref\" href=\"/docs/18/amcheck.html\" title=\"F.1.\u00a0amcheck \u2014 tools to verify table and index consistency\">amcheck</a></span>\n</div>\n</div></div>", "manual_path": "app-pgamcheck.html", "comparison_data": {"options": [{"names": ["-a", "--all"], "signature": "-a --all", "description": "Check all databases, except for any excluded via --exclude-database ."}, {"names": ["-d pattern", "--database= pattern"], "signature": "-d pattern --database= pattern", "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", "--exclude-database= pattern"], "signature": "-D pattern --exclude-database= pattern", "description": "Exclude databases matching the given pattern . This option can be specified more than once."}, {"names": ["-i pattern", "--index= pattern"], "signature": "-i pattern --index= 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", "--exclude-index= pattern"], "signature": "-I pattern --exclude-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": ["-r pattern", "--relation= pattern"], "signature": "-r pattern --relation= 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", "--exclude-relation= pattern"], "signature": "-R pattern --exclude-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": ["-s pattern", "--schema= pattern"], "signature": "-s pattern --schema= 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", "--exclude-schema= pattern"], "signature": "-S pattern --exclude-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": ["-t pattern", "--table= pattern"], "signature": "-t pattern --table= 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", "--exclude-table= pattern"], "signature": "-T pattern --exclude-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": ["--no-dependent-indexes"], "signature": "--no-dependent-indexes", "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-toast"], "signature": "--no-dependent-toast", "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-strict-names"], "signature": "--no-strict-names", "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": ["--exclude-toast-pointers"], "signature": "--exclude-toast-pointers", "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": ["--on-error-stop"], "signature": "--on-error-stop", "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": ["--skip= option"], "signature": "--skip= option", "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": ["--startblock= block"], "signature": "--startblock= block", "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": ["--endblock= block"], "signature": "--endblock= 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": ["--checkunique"], "signature": "--checkunique", "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": ["--heapallindexed"], "signature": "--heapallindexed", "description": "For each index checked, verify the presence of all heap tuples as index tuples in the index using amcheck 's heapallindexed option."}, {"names": ["--parent-check"], "signature": "--parent-check", "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": ["--rootdescend"], "signature": "--rootdescend", "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": ["-h hostname", "--host= hostname"], "signature": "-h hostname --host= hostname", "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": ["-p port", "--port= port"], "signature": "-p port --port= port", "description": "Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections."}, {"names": ["-U", "--username= username"], "signature": "-U --username= username", "description": "User name to connect as."}, {"names": ["-w", "--no-password"], "signature": "-w --no-password", "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", "--password"], "signature": "-W --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": ["--maintenance-db= dbname"], "signature": "--maintenance-db= dbname", "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": ["-e", "--echo"], "signature": "-e --echo", "description": "Echo to stdout all SQL sent to the server."}, {"names": ["-j num", "--jobs= num"], "signature": "-j num --jobs= num", "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": ["-P", "--progress"], "signature": "-P --progress", "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": ["-v", "--verbose"], "signature": "-v --verbose", "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", "--version"], "signature": "-V --version", "description": "Print the pg_amcheck version and exit."}, {"names": ["--install-missing", "--install-missing= schema"], "signature": "--install-missing --install-missing= schema", "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": ["-?", "--help"], "signature": "-? --help", "description": "Show help about pg_amcheck command line arguments, and exit."}], "synopsis": ["pg_amcheck [ option ...] [ dbname ]"], "environment": []}, "comparison_hash": "e007a3ce54383d588583bd426bfaa62aba42504ba26ff80ad24c0c65d13af539"}, "comparison": {"left": "14", "right": "15", "status": "changed", "diff": "--- PostgreSQL 14\n+++ PostgreSQL 15\n@@ -26,7 +26,7 @@\n       \"signature\": \"-D pattern --exclude-database= pattern\"\n     },\n     {\n-      \"description\": \"Check indexes matching the specified pattern , unless they are otherwise excluded. This option can be specified more than once. This is similar to the --relation option, except that it applies only to indexes, not tables.\",\n+      \"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.\",\n       \"names\": [\n         \"-i pattern\",\n         \"--index= pattern\"\n@@ -34,7 +34,7 @@\n       \"signature\": \"-i pattern --index= pattern\"\n     },\n     {\n-      \"description\": \"Exclude indexes matching the specified pattern . This option can be specified more than once. This is similar to the --exclude-relation option, except that it applies only to indexes, not tables.\",\n+      \"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.\",\n       \"names\": [\n         \"-I pattern\",\n         \"--exclude-index= pattern\"\n@@ -74,7 +74,7 @@\n       \"signature\": \"-S pattern --exclude-schema= pattern\"\n     },\n     {\n-      \"description\": \"Check tables matching the specified pattern , unless they are otherwise excluded. This option can be specified more than once. This is similar to the --relation option, except that it applies only to tables, not indexes.\",\n+      \"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.\",\n       \"names\": [\n         \"-t pattern\",\n         \"--table= pattern\"\n@@ -82,7 +82,7 @@\n       \"signature\": \"-t pattern --table= pattern\"\n     },\n     {\n-      \"description\": \"Exclude tables matching the specified pattern . This option can be specified more than once. This is similar to the --exclude-relation option, except that it applies only to tables, not indexes.\",\n+      \"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.\",\n       \"names\": [\n         \"-T pattern\",\n         \"--exclude-table= pattern\""}}