pg_amcheck
pg_amcheck — checks for corruption in one or more PostgreSQL databases
当前阅读 PG 18·选择有来源记录的版本
此版本暂无所选语言的定义,以下显示原始英文内容。
- Documented executable
- pg_amcheck
- Executable version
- 18.6
- Reference inventory
- Client applications
- Option definition groups
- 36
- environment
- 未知
- manual path
- app-pgamcheck.html
- signature
- pg_amcheck [ option ...] [ dbname ]
- synopsis
- pg_amcheck [ option ...] [ dbname ]
版本定义 PG 18
pg_amcheck
pg_amcheck — checks for corruption in one or more PostgreSQL databases
Synopsis
pg_amcheck [option...] [dbname]
Description
pg_amcheck supports running amcheck'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.
Only ordinary and toast table relations, materialized views, sequences, and btree indexes are currently supported. Other relation types are silently skipped.
If dbname 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 --all, --database and --exclude-database. They also include --relation, --exclude-relation, --table, --exclude-table, --index, and --exclude-index, but only when such options are used with a three-part pattern (e.g. mydb*.myschema*.myrel*). Finally, they include --schema and --exclude-schema when such options are used with a two-part pattern (e.g. mydb*.myschema*).
dbname can also be a connection string.
Options
The following command-line options control what is checked:
-a--all-
Check all databases, except for any excluded via
--exclude-database. -dpattern--database=pattern-
Check databases matching the specified
pattern, except for any excluded by--exclude-database. This option can be specified more than once. -Dpattern--exclude-database=pattern-
Exclude databases matching the given
pattern. This option can be specified more than once. -ipattern--index=pattern-
Check indexes matching the specified
pattern, unless they are otherwise excluded. This option can be specified more than once.This is similar to the
--relationoption, except that it applies only to indexes, not to other relation types. -Ipattern--exclude-index=pattern-
Exclude indexes matching the specified
pattern. This option can be specified more than once.This is similar to the
--exclude-relationoption, except that it applies only to indexes, not other relation types. -rpattern--relation=pattern-
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. -Rpattern--exclude-relation=pattern-
Exclude relations matching the specified
pattern. This option can be specified more than once.As with
--relation, thepatternmay be unqualified, schema-qualified, or database- and schema-qualified. -spattern--schema=pattern-
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 matchingmyschema*in databases matchingmydb*. -Spattern--exclude-schema=pattern-
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. -tpattern--table=pattern-
Check tables matching the specified
pattern, unless they are otherwise excluded. This option can be specified more than once.This is similar to the
--relationoption, except that it applies only to tables, materialized views, and sequences, not to indexes. -Tpattern--exclude-table=pattern-
Exclude tables matching the specified
pattern. This option can be specified more than once.This is similar to the
--exclude-relationoption, except that it applies only to tables, materialized views, and sequences, not to indexes. --no-dependent-indexes-
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
--indexor--relation. This option suppresses that behavior. --no-dependent-toast-
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
--tableor--relation. This option suppresses that behavior. --no-strict-names-
By default, if an argument to
--database,--table,--index, or--relationmatches no objects, it is a fatal error. This option downgrades that error to a warning.
The following command-line options control checking of tables:
--exclude-toast-pointers-
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.
--on-error-stop-
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.
--skip=option-
If
all-frozenis given, table corruption checks will skip over pages in all tables that are marked as all frozen.If
all-visibleis 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. --startblock=block-
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
--endblockfor further caveats. --endblock=block-
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.
The following command-line options control checking of B-tree indexes:
--checkunique-
For each index with unique constraint checked, verify that no more than one among duplicate entries is visible in the index using amcheck's
checkuniqueoption. --heapallindexed-
For each index checked, verify the presence of all heap tuples as index tuples in the index using amcheck's
heapallindexedoption. --parent-check-
For each btree index checked, use amcheck's
bt_index_parent_checkfunction, which performs additional checks of parent/child relationships during index checking.The default is to use amcheck's
bt_index_checkfunction, but note that use of the--rootdescendoption implicitly selectsbt_index_parent_check. --rootdescend-
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
rootdescendoption.Use of this option implicitly also selects the
--parent-checkoption.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.
Warning
The extra checks performed against B-tree indexes when the --parent-check option or the --rootdescend option is specified require relatively strong relation-level locks. These checks are the only checks that will block concurrent data modification from INSERT, UPDATE, and DELETE commands.
The following command-line options control the connection to the server:
-hhostname--host=hostname-
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.
-pport--port=port-
Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections.
-U--username=username-
User name to connect as.
-w--no-password-
Never issue a password prompt. If the server requires password authentication and a password is not available by other means such as a
.pgpassfile, the connection attempt will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password. -W--password-
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
-Wto avoid the extra connection attempt. --maintenance-db=dbname-
Specifies a database or connection string to be used to discover the list of databases to be checked. If neither
--allnor 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 ispostgresor, if that fails,template1.
Other options are also available:
-e--echo-
Echo to stdout all SQL sent to the server.
-jnum--jobs=num-
Use
numconcurrent connections to the server, or one per object to be checked, whichever is less.The default is to use a single connection.
-P--progress-
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.
-v--verbose-
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.
-V--version-
Print the pg_amcheck version and exit.
--install-missing--install-missing=schema-
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 schemapg_catalog.At present, the only required extension is amcheck.
-?--help-
Show help about pg_amcheck command line arguments, and exit.
Environment
pg_amcheck, like most other PostgreSQL utilities, also uses the environment variables supported by libpq (see Section 32.15).
The environment variable PG_COLOR specifies whether to use color in diagnostic messages. Possible values are always, auto and never.
Notes
pg_amcheck is designed to work with PostgreSQL 14.0 and later.
See Also
amcheckDocumented options
| Option and arguments | Description |
|---|---|
| -a --all | Check all databases, except for any excluded via --exclude-database . |
| -d pattern --database= pattern | Check databases matching the specified pattern , except for any excluded by --exclude-database . This option can be specified more than once. |
| -D pattern --exclude-database= pattern | Exclude databases matching the given pattern . This option can be specified more than once. |
| -i pattern --index= pattern | Check indexes matching the specified pattern , unless they are otherwise excluded. This option can be specified more than once. |
| -I pattern --exclude-index= pattern | Exclude indexes matching the specified pattern . This option can be specified more than once. |
| -r pattern --relation= pattern | Check relations matching the specified pattern , unless they are otherwise excluded. This option can be specified more than once. |
| -R pattern --exclude-relation= pattern | Exclude relations matching the specified pattern . This option can be specified more than once. |
| -s pattern --schema= pattern | Check tables and indexes in schemas matching the specified pattern , unless they are otherwise excluded. This option can be specified more than once. |
| -S pattern --exclude-schema= pattern | Exclude tables and indexes in schemas matching the specified pattern . This option can be specified more than once. |
| -t pattern --table= pattern | Check tables matching the specified pattern , unless they are otherwise excluded. This option can be specified more than once. |
| -T pattern --exclude-table= pattern | Exclude tables matching the specified pattern . This option can be specified more than once. |
| --no-dependent-indexes | 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. |
| --no-dependent-toast | 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. |
| --no-strict-names | 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. |
| --exclude-toast-pointers | 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. |
| --on-error-stop | 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. |
| --skip= option | If all-frozen is given, table corruption checks will skip over pages in all tables that are marked as all frozen. |
| --startblock= block | 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. |
| --endblock= block | 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 . |
| --checkunique | 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. |
| --heapallindexed | For each index checked, verify the presence of all heap tuples as index tuples in the index using amcheck 's heapallindexed option. |
| --parent-check | For each btree index checked, use amcheck 's bt_index_parent_check function, which performs additional checks of parent/child relationships during index checking. |
| --rootdescend | 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. |
| -h hostname --host= hostname | 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 port --port= port | Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections. |
| -U --username= username | User name to connect as. |
| -w --no-password | 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. |
| -W --password | Force pg_amcheck to prompt for a password before connecting to a database. |
| --maintenance-db= dbname | 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 . |
| -e --echo | Echo to stdout all SQL sent to the server. |
| -j num --jobs= num | Use num concurrent connections to the server, or one per object to be checked, whichever is less. |
| -P --progress | 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. |
| -v --verbose | 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. |
| -V --version | Print the pg_amcheck version and exit. |
| --install-missing --install-missing= schema | 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 . |
| -? --help | Show help about pg_amcheck command line arguments, and exit. |
比较版本
完整来源事实
options
map[description:Check all databases, except for any excluded via --exclude-database . names:[-a --all] signature:-a --all source_url:/docs/18/app-pgamcheck.html summary:Check all databases, except for any excluded via --exclude-database .], map[description:Check databases matching the specified pattern , except for any excluded by --exclude-database . This option can be specified more than once. names:[-d pattern --database= pattern] signature:-d pattern --database= pattern source_url:/docs/18/app-pgamcheck.html summary:Check databases matching the specified pattern , except for any excluded by --exclude-database . This option can be specified more than once.], map[description:Exclude databases matching the given pattern . This option can be specified more than once. names:[-D pattern --exclude-database= pattern] signature:-D pattern --exclude-database= pattern source_url:/docs/18/app-pgamcheck.html summary:Exclude databases matching the given pattern . This option can be specified more than once.], map[description:Check indexes matching the specified pattern , unless they are otherwise excluded. This option can be specified more than once. This is similar to the --relation option, except that it applies only to indexes, not to other relation types. names:[-i pattern --index= pattern] signature:-i pattern --index= pattern source_url:/docs/18/app-pgamcheck.html summary:Check indexes matching the specified pattern , unless they are otherwise excluded. This option can be specified more than once.], map[description:Exclude indexes matching the specified pattern . This option can be specified more than once. This is similar to the --exclude-relation option, except that it applies only to indexes, not other relation types. names:[-I pattern --exclude-index= pattern] signature:-I pattern --exclude-index= pattern source_url:/docs/18/app-pgamcheck.html summary:Exclude indexes matching the specified pattern . This option can be specified more than once.], map[description:Check relations matching the specified pattern , unless they are otherwise excluded. This option can be specified more than once. Patterns may be unqualified, e.g. myrel* , or they may be schema-qualified, e.g. myschema*.myrel* or database-qualified and schema-qualified, e.g. mydb*.myschema*.myrel* . A database-qualified pattern will add matching databases to the list of databases to be checked. names:[-r pattern --relation= pattern] signature:-r pattern --relation= pattern source_url:/docs/18/app-pgamcheck.html summary:Check relations matching the specified pattern , unless they are otherwise excluded. This option can be specified more than once.], map[description:Exclude relations matching the specified pattern . This option can be specified more than once. As with --relation , the pattern may be unqualified, schema-qualified, or database- and schema-qualified. names:[-R pattern --exclude-relation= pattern] signature:-R pattern --exclude-relation= pattern source_url:/docs/18/app-pgamcheck.html summary:Exclude relations matching the specified pattern . This option can be specified more than once.], map[description:Check tables and indexes in schemas matching the specified pattern , unless they are otherwise excluded. This option can be specified more than once. To select only tables in schemas matching a particular pattern, consider using something like --table=SCHEMAPAT.* --no-dependent-indexes . To select only indexes, consider using something like --index=SCHEMAPAT.* . A schema pattern may be database-qualified. For example, you may write --schema=mydb*.myschema* to select schemas matching myschema* in databases matching mydb* . names:[-s pattern --schema= pattern] signature:-s pattern --schema= pattern source_url:/docs/18/app-pgamcheck.html summary:Check tables and indexes in schemas matching the specified pattern , unless they are otherwise excluded. This option can be specified more than once.], map[description:Exclude tables and indexes in schemas matching the specified pattern . This option can be specified more than once. As with --schema , the pattern may be database-qualified. names:[-S pattern --exclude-schema= pattern] signature:-S pattern --exclude-schema= pattern source_url:/docs/18/app-pgamcheck.html summary:Exclude tables and indexes in schemas matching the specified pattern . This option can be specified more than once.], map[description:Check tables matching the specified pattern , unless they are otherwise excluded. This option can be specified more than once. This is similar to the --relation option, except that it applies only to tables, materialized views, and sequences, not to indexes. names:[-t pattern --table= pattern] signature:-t pattern --table= pattern source_url:/docs/18/app-pgamcheck.html summary:Check tables matching the specified pattern , unless they are otherwise excluded. This option can be specified more than once.], map[description:Exclude tables matching the specified pattern . This option can be specified more than once. This is similar to the --exclude-relation option, except that it applies only to tables, materialized views, and sequences, not to indexes. names:[-T pattern --exclude-table= pattern] signature:-T pattern --exclude-table= pattern source_url:/docs/18/app-pgamcheck.html summary:Exclude tables matching the specified pattern . This option can be specified more than once.], map[description:By default, if a table is checked, any btree indexes of that table will also be checked, even if they are not explicitly selected by an option such as --index or --relation . This option suppresses that behavior. names:[--no-dependent-indexes] signature:--no-dependent-indexes source_url:/docs/18/app-pgamcheck.html summary:By default, if a table is checked, any btree indexes of that table will also be checked, even if they are not explicitly selected by an option such as --index or --relation . This option suppresses that behavior.], map[description:By default, if a table is checked, its toast table, if any, will also be checked, even if it is not explicitly selected by an option such as --table or --relation . This option suppresses that behavior. names:[--no-dependent-toast] signature:--no-dependent-toast source_url:/docs/18/app-pgamcheck.html summary:By default, if a table is checked, its toast table, if any, will also be checked, even if it is not explicitly selected by an option such as --table or --relation . This option suppresses that behavior.], map[description:By default, if an argument to --database , --table , --index , or --relation matches no objects, it is a fatal error. This option downgrades that error to a warning. names:[--no-strict-names] signature:--no-strict-names source_url:/docs/18/app-pgamcheck.html summary:By default, if an argument to --database , --table , --index , or --relation matches no objects, it is a fatal error. This option downgrades that error to a warning.], map[description:By default, whenever a toast pointer is encountered in a table, a lookup is performed to ensure that it references apparently-valid entries in the toast table. These checks can be quite slow, and this option can be used to skip them. names:[--exclude-toast-pointers] signature:--exclude-toast-pointers source_url:/docs/18/app-pgamcheck.html summary:By default, whenever a toast pointer is encountered in a table, a lookup is performed to ensure that it references apparently-valid entries in the toast table. These checks can be quite slow, and this option can be used to skip them.], map[description:After reporting all corruptions on the first page of a table where corruption is found, stop processing that table relation and move on to the next table or index. Note that index checking always stops after the first corrupt page. This option only has meaning relative to table relations. names:[--on-error-stop] signature:--on-error-stop source_url:/docs/18/app-pgamcheck.html summary:After reporting all corruptions on the first page of a table where corruption is found, stop processing that table relation and move on to the next table or index.], map[description:If all-frozen is given, table corruption checks will skip over pages in all tables that are marked as all frozen. If all-visible is given, table corruption checks will skip over pages in all tables that are marked as all visible. By default, no pages are skipped. This can be specified as none , but since this is the default, it need not be mentioned. names:[--skip= option] signature:--skip= option source_url:/docs/18/app-pgamcheck.html summary:If all-frozen is given, table corruption checks will skip over pages in all tables that are marked as all frozen.], map[description:Start checking at the specified block number. An error will occur if the table relation being checked has fewer than this number of blocks. This option does not apply to indexes, and is probably only useful when checking a single table relation. See --endblock for further caveats. names:[--startblock= block] signature:--startblock= block source_url:/docs/18/app-pgamcheck.html summary:Start checking at the specified block number. An error will occur if the table relation being checked has fewer than this number of blocks. This option does not apply to indexes, and is probably only useful when checking a single table relation. See --endblock for further caveats.], map[description:End checking at the specified block number. An error will occur if the table relation being checked has fewer than this number of blocks. This option does not apply to indexes, and is probably only useful when checking a single table relation. If both a regular table and a toast table are checked, this option will apply to both, but higher-numbered toast blocks may still be accessed while validating toast pointers, unless that is suppressed using --exclude-toast-pointers . names:[--endblock= block] signature:--endblock= block source_url:/docs/18/app-pgamcheck.html summary:End checking at the specified block number. An error will occur if the table relation being checked has fewer than this number of blocks. This option does not apply to indexes, and is probably only useful when checking a single table relation. If both a regular table and a toast table are checked, this option will apply to both, but higher-numbered toast blocks may still be accessed while validating toast pointers, unless that is suppressed using --exclude-toast-pointers .], map[description:For each index with unique constraint checked, verify that no more than one among duplicate entries is visible in the index using amcheck 's checkunique option. names:[--checkunique] signature:--checkunique source_url:/docs/18/app-pgamcheck.html summary:For each index with unique constraint checked, verify that no more than one among duplicate entries is visible in the index using amcheck 's checkunique option.], map[description:For each index checked, verify the presence of all heap tuples as index tuples in the index using amcheck 's heapallindexed option. names:[--heapallindexed] signature:--heapallindexed source_url:/docs/18/app-pgamcheck.html summary:For each index checked, verify the presence of all heap tuples as index tuples in the index using amcheck 's heapallindexed option.], map[description:For each btree index checked, use amcheck 's bt_index_parent_check function, which performs additional checks of parent/child relationships during index checking. The default is to use amcheck 's bt_index_check function, but note that use of the --rootdescend option implicitly selects bt_index_parent_check . names:[--parent-check] signature:--parent-check source_url:/docs/18/app-pgamcheck.html summary:For each btree index checked, use amcheck 's bt_index_parent_check function, which performs additional checks of parent/child relationships during index checking.], map[description:For each index checked, re-find tuples on the leaf level by performing a new search from the root page for each tuple using amcheck 's rootdescend option. Use of this option implicitly also selects the --parent-check option. This form of verification was originally written to help in the development of btree index features. It may be of limited use or even of no use in helping detect the kinds of corruption that occur in practice. It may also cause corruption checking to take considerably longer and consume considerably more resources on the server. names:[--rootdescend] signature:--rootdescend source_url:/docs/18/app-pgamcheck.html summary:For each index checked, re-find tuples on the leaf level by performing a new search from the root page for each tuple using amcheck 's rootdescend option.], map[description:Specifies the host name of the machine on which the server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket. names:[-h hostname --host= hostname] signature:-h hostname --host= hostname source_url:/docs/18/app-pgamcheck.html summary:Specifies the host name of the machine on which the server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket.], map[description:Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections. names:[-p port --port= port] signature:-p port --port= port source_url:/docs/18/app-pgamcheck.html summary:Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections.], map[description:User name to connect as. names:[-U --username= username] signature:-U --username= username source_url:/docs/18/app-pgamcheck.html summary:User name to connect as.], map[description:Never issue a password prompt. If the server requires password authentication and a password is not available by other means such as a .pgpass file, the connection attempt will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password. names:[-w --no-password] signature:-w --no-password source_url:/docs/18/app-pgamcheck.html summary:Never issue a password prompt. If the server requires password authentication and a password is not available by other means such as a .pgpass file, the connection attempt will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password.], map[description:Force pg_amcheck to prompt for a password before connecting to a database. This option is never essential, since pg_amcheck will automatically prompt for a password if the server demands password authentication. However, pg_amcheck will waste a connection attempt finding out that the server wants a password. In some cases it is worth typing -W to avoid the extra connection attempt. names:[-W --password] signature:-W --password source_url:/docs/18/app-pgamcheck.html summary:Force pg_amcheck to prompt for a password before connecting to a database.], map[description:Specifies a database or connection string to be used to discover the list of databases to be checked. If neither --all nor any option including a database pattern is used, no such connection is required and this option does nothing. Otherwise, any connection string parameters other than the database name which are included in the value for this option will also be used when connecting to the databases being checked. If this option is omitted, the default is postgres or, if that fails, template1 . names:[--maintenance-db= dbname] signature:--maintenance-db= dbname source_url:/docs/18/app-pgamcheck.html summary:Specifies a database or connection string to be used to discover the list of databases to be checked. If neither --all nor any option including a database pattern is used, no such connection is required and this option does nothing. Otherwise, any connection string parameters other than the database name which are included in the value for this option will also be used when connecting to the databases being checked. If this option is omitted, the default is postgres or, if that fails, template1 .], map[description:Echo to stdout all SQL sent to the server. names:[-e --echo] signature:-e --echo source_url:/docs/18/app-pgamcheck.html summary:Echo to stdout all SQL sent to the server.], map[description:Use num concurrent connections to the server, or one per object to be checked, whichever is less. The default is to use a single connection. names:[-j num --jobs= num] signature:-j num --jobs= num source_url:/docs/18/app-pgamcheck.html summary:Use num concurrent connections to the server, or one per object to be checked, whichever is less.], map[description:Show progress information. Progress information includes the number of relations for which checking has been completed, and the total size of those relations. It also includes the total number of relations that will eventually be checked, and the estimated size of those relations. names:[-P --progress] signature:-P --progress source_url:/docs/18/app-pgamcheck.html summary:Show progress information. Progress information includes the number of relations for which checking has been completed, and the total size of those relations. It also includes the total number of relations that will eventually be checked, and the estimated size of those relations.], map[description:Print more messages. In particular, this will print a message for each relation being checked, and will increase the level of detail shown for server errors. names:[-v --verbose] signature:-v --verbose source_url:/docs/18/app-pgamcheck.html summary:Print more messages. In particular, this will print a message for each relation being checked, and will increase the level of detail shown for server errors.], map[description:Print the pg_amcheck version and exit. names:[-V --version] signature:-V --version source_url:/docs/18/app-pgamcheck.html summary:Print the pg_amcheck version and exit.], map[description:Install any missing extensions that are required to check the database(s). If not yet installed, each extension's objects will be installed into the given schema , or if not specified into schema pg_catalog . At present, the only required extension is amcheck . names:[--install-missing --install-missing= schema] signature:--install-missing --install-missing= schema source_url:/docs/18/app-pgamcheck.html summary:Install any missing extensions that are required to check the database(s). If not yet installed, each extension's objects will be installed into the given schema , or if not specified into schema pg_catalog .], map[description:Show help about pg_amcheck command line arguments, and exit. names:[-? --help] signature:-? --help source_url:/docs/18/app-pgamcheck.html summary:Show help about pg_amcheck command line arguments, and exit.]
来源引用
定义来源
center · PostgreSQL 18 · ee8d1a3612338fd9adf250730cb640fcc5233b5491337cc00a316a44e3a0b9f8
正文语言: en · ee8d1a3612338fd9adf250730cb640fcc5233b5491337cc00a316a44e3a0b9f8