Options
- pg_amcheck accepts the following command-line arguments :
+ The following command-line options control what is checked :
- -e
- --echo
+ -i pattern
+ --index=pattern
- Echo to stdout all SQL sent to the server.
+ Check indexes matching the specified
+ pattern ,
+ unless they are otherwise excluded.
+ This option can be specified more than once.
-
-
-
-
- --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 .
+ This is similar to the --relation option, except that
+ it applies only to indexes, not tables.
- --exclude-toast-pointers
+ -I pattern
+ --exclude-index=pattern
- 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.
+ Exclude indexes matching the specified
+ pattern .
+ This option can be specified more than once.
-
-
-
-
- --heapallindexed
-
- For each index checked, verify the presence of all heap tuples as index
- tuples in the index using 's
- heapallindexed option.
+ This is similar to the --exclude-relation option,
+ except that it applies only to indexes, not tables.
- -?
- --help
+ -r pattern
+ --relation=pattern
- Show help about
pg_amcheck command line
- arguments, and exit.
+ 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*.myscheam*.myrel* . A database-qualified
+ pattern will add matching databases to the list of databases to be
+ checked.
- -h hostname
- --host=hostname
+ -R pattern
+ --exclude-relation=pattern
- 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.
+ 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.
- -i pattern
- --index =pattern
+ -s pattern
+ --schema =pattern
- Check indexes matching the specified
- pattern ,
- unless they are otherwise excluded.
+ Check tables and indexes in schemas 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.
+ 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* .
- -I pattern
- --exclude-index =pattern
+ -S pattern
+ --exclude-schema =pattern
- Exclude indexe s matching the specified
+ Exclude tables and indexes in schema s 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 .
+ As with --schema , the pattern may be
+ database-qualified .
- --install-missing
- --install-missing=schema
+ -t pattern
+ --table=pattern
- 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 .
+ Check tables matching the specified
+ pattern ,
+ unless they are otherwise excluded.
+ This option can be specified more than once.
- At present, the only required extension is .
+ This is similar to the --relation option, except that
+ it applies only to tables, not indexes.
- -j num
- --jobs=num
+ -T pattern
+ --exclude-table=pattern
- Use num concurrent connections to the server,
- or one per object to be checked, whichever is less.
+ Exclude tables matching the specified
+ pattern .
+ This option can be specified more than once.
- The default is to use a single connection.
+ This is similar to the --exclude-relation option,
+ except that it applies only to tables, not indexes.
- --maintenance-db=dbname
+ --no-dependent-indexes
- 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 .
+ 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-indexes
+ --no-dependent-toast
- 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.
+ 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.
+
+
+ The following command-line options control checking of tables:
+
+
- --no-dependent-toast
+ --exclude-toast-pointers
- 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 .
+ 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 .
- --parent-check
+ --skip=option
- For each btree index checked, use 's
- bt_index_parent_check function, which performs
- additional checks of parent/child relationships during index checking.
+ If all-frozen is given, table corruption checks
+ will skip over pages in all tables that are marked as all frozen.
- 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 .
+ If all-visible is given, table corruption checks
+ will skip over pages in all tables that are marked as all visible.
-
-
-
-
- -p port
- --port=port
-
- Specifies the TCP port or local Unix domain socket file extension on
- which the server is listening for connections.
+ By default, no pages are skipped. This can be specified as
+ none , but since this is the default, it need not be
+ mentioned.
- -P
- --progress
+ --startblock=block
- 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
- relation s.
+ 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 caveat s.
- -q
- --quiet
+ --endblock=block
- Print fewer messages, and less detail regarding any server errors.
+ 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:
+
+
- -r pattern
- --relation=pattern
+ --heapallindexed
- 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*.myscheam*.myrel* . A database-qualified
- pattern will add matching databases to the list of databases to be
- checked.
+ For each index checked, verify the presence of all heap tuples as index
+ tuples in the index using 's
+ heapallindexed option.
- -R pattern
- --exclude-relation=pattern
+ --parent-check
- Exclude relations matching the specified
- <link linkend="app-psql-patterns">pattern .
- This option can be specified more than once .
+ For each btree index checked, use 's
+ <function>bt_index_parent_check function, which performs
+ additional checks of parent/child relationships during index checking .
- As with --relation , the
- pattern may be unqualified, schema-qualified,
- or database- and schema-qualified.
+ 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 .
+
+
+ The following command-line options control the connection to the server:
+
+
- -s pattern
- --schema=pattern
+ -h hostname
+ --host=hostname
- 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.* .
+ 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
+
- A schema pattern may be database-qualified. For example, you may
- write --schema=mydb*.myschema* to select
- schemas matching myschema* in databases matching
- mydb* .
+ Specifies the TCP port or local Unix domain socket file extension on
+ which the server is listening for connections.
- -S pattern
- --exclude-schema=pattern
+ -U
+ --username=username
- Exclude tables and indexes in schemas matching the specified
- pattern .
- This option can be specified more than once.
+ User name to connect as.
+
+
+
+
+ -w
+ --no-password
+
- As with --schema , the pattern may be
- database-qualified.
+ 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.
- --skip=option
+ -W
+ --password
- If all-frozen is given, table corruption checks
- will skip over pages in all tables that are marked as all frozen .
+ Force
pg_amcheck to prompt for a password
+ before connecting to a database .
- If all-visible is given, table corruption checks
- will skip over pages in all tables that are marked as all visible.
+ 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.
+
+
+
+
+ --maintenance-db=dbname
+
- By default, no pages are skipped. This can be specified as
- none , but since this is the default, it need not be
- mentioned.
+ 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 .
+
+
+
+ Other options are also available:
+
- --startblock=block
+ -e
+ --echo
- 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.
+ Echo to stdout all SQL sent to the server.
- -t pattern
- --table=pattern
+ -j num
+ --jobs=num
- Check tables matching the specified
- pattern ,
- unless they are otherwise excluded.
- This option can be specified more than once.
+ Use num concurrent connections to the server,
+ or one per object to be checked, whichever is less.
- This is similar to the --relation option, except that
- it applies only to tables, not indexes.
+ The default is to use a single connection.
- -T pattern
- --exclude-table=pattern
+ -q
+ --quiet
- 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.
+ Print fewer messages, and less detail regarding any server errors.
- -U
- --username=username
+ -P
+ --progress
- User name to connect as.
+ 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.
- -w
- --no-password
+ --install-missing
+ --install-missing=schema
- 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.
+ 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 .
- -W
- --password
+ -?
+ --help
- 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.
+ Show help about
pg_amcheck command line
+ arguments, and exit.
-