|
PostgreSQL Source Code git master
|
#include "postgres_fe.h"#include <limits.h>#include <time.h>#include "catalog/pg_am_d.h"#include "catalog/pg_class_d.h"#include "catalog/pg_namespace_d.h"#include "common/logging.h"#include "common/username.h"#include "fe_utils/cancel.h"#include "fe_utils/option_utils.h"#include "fe_utils/parallel_slot.h"#include "fe_utils/query_utils.h"#include "fe_utils/simple_list.h"#include "fe_utils/string_utils.h"#include "getopt_long.h"#include "pgtime.h"#include "storage/block.h"
Go to the source code of this file.
Data Structures | |
| struct | PatternInfo |
| struct | PatternInfoArray |
| struct | AmcheckOptions |
| struct | DatabaseInfo |
| struct | RelationInfo |
Macros | |
| #define | log_no_match(...) |
| #define | FREE_AND_SET_NULL(x) |
| #define | VERBOSE_DATNAME_LENGTH 35 |
| #define log_no_match | ( | ... | ) |
Definition at line 207 of file pg_amcheck.c.
| #define VERBOSE_DATNAME_LENGTH 35 |
|
static |
Definition at line 1512 of file pg_amcheck.c.
References append_relation_pattern_helper(), encoding, and fb().
Referenced by main().
|
static |
Definition at line 1358 of file pg_amcheck.c.
References buf, PatternInfo::db_regex, encoding, extend_pattern_info_array(), fb(), initPQExpBuffer(), PatternInfo::pattern, patternToSQLRegex(), pg_log_error, pstrdup(), and termPQExpBuffer().
Referenced by main().
|
static |
Definition at line 1539 of file pg_amcheck.c.
References appendPQExpBuffer(), appendPQExpBufferChar(), appendPQExpBufferStr(), appendStringLiteralConn(), buf, comma, conn, PatternInfo::db_regex, fb(), PatternInfo::nsp_regex, and PatternInfo::rel_regex.
Referenced by compile_database_list().
|
static |
Definition at line 1496 of file pg_amcheck.c.
References append_relation_pattern_helper(), encoding, and fb().
Referenced by main().
|
static |
Definition at line 1846 of file pg_amcheck.c.
References appendPQExpBuffer(), appendPQExpBufferStr(), appendStringLiteralConn(), buf, conn, fb(), and PQdb().
Referenced by compile_relation_list_one_db().
|
static |
Definition at line 1777 of file pg_amcheck.c.
References appendPQExpBuffer(), appendPQExpBufferChar(), appendPQExpBufferStr(), appendStringLiteralConn(), PatternInfo::btree_only, buf, comma, conn, PatternInfo::db_regex, fb(), PatternInfo::heap_only, PatternInfo::nsp_regex, and PatternInfo::rel_regex.
Referenced by compile_relation_list_one_db().
|
static |
Definition at line 1480 of file pg_amcheck.c.
References append_relation_pattern_helper(), encoding, and fb().
Referenced by main().
|
static |
Definition at line 1430 of file pg_amcheck.c.
References PatternInfo::btree_only, PatternInfo::db_regex, AmcheckOptions::dbpattern, encoding, extend_pattern_info_array(), fb(), PatternInfo::heap_only, initPQExpBuffer(), PatternInfo::nsp_regex, opts, PatternInfo::pattern, patternToSQLRegex(), pg_log_error, pstrdup(), PatternInfo::rel_regex, and termPQExpBuffer().
Referenced by append_btree_pattern(), append_heap_pattern(), and append_relation_pattern().
|
static |
Definition at line 1388 of file pg_amcheck.c.
References PatternInfo::db_regex, AmcheckOptions::dbpattern, encoding, extend_pattern_info_array(), fb(), initPQExpBuffer(), PatternInfo::nsp_regex, opts, PatternInfo::pattern, patternToSQLRegex(), pg_log_error, pstrdup(), and termPQExpBuffer().
Referenced by main().
|
static |
Definition at line 1585 of file pg_amcheck.c.
References AmcheckOptions::alldb, append_db_pattern_cte(), appendPQExpBufferStr(), Assert, conn, PatternInfoArray::data, PQExpBufferData::data, datname, disconnectDatabase(), AmcheckOptions::echo, AmcheckOptions::exclude, executeQuery(), fb(), i, AmcheckOptions::include, initPQExpBuffer(), PatternInfoArray::len, log_no_match, opts, PatternInfo::pattern, pg_fatal, pg_log_error, pg_log_error_detail, pg_log_info, pg_malloc0(), PGRES_TUPLES_OK, PQclear, PQerrorMessage(), PQgetisnull, PQgetvalue, PQntuples, PQresultStatus, pstrdup(), simple_ptr_list_append(), AmcheckOptions::strict_names, termPQExpBuffer(), and AmcheckOptions::verbose.
Referenced by main().
|
static |
Definition at line 1885 of file pg_amcheck.c.
References AmcheckOptions::allrel, append_rel_pattern_filtered_cte(), append_rel_pattern_raw_cte(), appendPQExpBuffer(), appendPQExpBufferStr(), Assert, atooid, RelationInfo::blocks_to_check, conn, CppAsString2, PatternInfoArray::data, PQExpBufferData::data, RelationInfo::datinfo, disconnectDatabase(), AmcheckOptions::echo, AmcheckOptions::endblock, AmcheckOptions::exclude, AmcheckOptions::excludeidx, AmcheckOptions::excludensp, AmcheckOptions::excludetbl, executeQuery(), fb(), i, AmcheckOptions::include, initPQExpBuffer(), InvalidOid, RelationInfo::is_heap, PatternInfoArray::len, PatternInfo::matched, AmcheckOptions::no_btree_expansion, AmcheckOptions::no_toast_expansion, RelationInfo::nspname, OidIsValid, opts, pg_fatal, pg_log_error, pg_log_error_detail, pg_malloc0(), PG_USED_FOR_ASSERTS_ONLY, PGRES_TUPLES_OK, PQclear, PQerrorMessage(), PQgetisnull, PQgetvalue, PQntuples, PQresultStatus, pstrdup(), RelationInfo::relname, relname, RelationInfo::reloid, RelationInfo::relpages, simple_ptr_list_append(), AmcheckOptions::startblock, and termPQExpBuffer().
Referenced by main().
|
static |
Definition at line 1336 of file pg_amcheck.c.
References fb(), and pg_realloc().
Referenced by append_database_pattern(), append_relation_pattern_helper(), and append_schema_pattern().
Definition at line 1183 of file pg_amcheck.c.
Definition at line 1008 of file pg_amcheck.c.
References appendPQExpBufferChar(), appendPQExpBufferStr(), buf, initPQExpBuffer(), pstrdup(), str, and termPQExpBuffer().
Referenced by verify_btree_slot_handler(), and verify_heap_slot_handler().
Definition at line 220 of file pg_amcheck.c.
References all_checks_pass, AmcheckOptions::alldb, AmcheckOptions::allrel, amcheck_sql, append_btree_pattern(), append_database_pattern(), append_heap_pattern(), append_relation_pattern(), append_schema_pattern(), RelationInfo::blocks_to_check, CancelRequested, AmcheckOptions::checkunique, compile_database_list(), compile_relation_list_one_db(), conn, connectDatabase(), connectMaintenanceDatabase(), PatternInfoArray::data, PQExpBufferData::data, RelationInfo::datinfo, DatabaseInfo::datname, _connParams::dbname, AmcheckOptions::dbpattern, disconnectDatabase(), AmcheckOptions::echo, encoding, AmcheckOptions::endblock, AmcheckOptions::exclude, AmcheckOptions::excludeidx, AmcheckOptions::excludensp, AmcheckOptions::excludetbl, executeCommand(), executeQuery(), fb(), fprintf, FREE_AND_SET_NULL, get_progname(), get_user_name_or_exit(), getopt_long(), handle_help_version_opts(), SimplePtrList::head, AmcheckOptions::heapallindexed, help(), AmcheckOptions::include, initPQExpBuffer(), AmcheckOptions::install_missing, AmcheckOptions::install_schema, RelationInfo::is_heap, AmcheckOptions::jobs, PatternInfoArray::len, log_no_match, MaxBlockNumber, SimplePtrListCell::next, no_argument, AmcheckOptions::no_btree_expansion, AmcheckOptions::no_toast_expansion, RelationInfo::nspname, AmcheckOptions::on_error_stop, optarg, optind, option_parse_int(), optional_argument, opts, _connParams::override_dbname, ParallelSlotsAdoptConn(), ParallelSlotSetHandler(), ParallelSlotsGetIdle(), ParallelSlotsSetup(), ParallelSlotsTerminate(), ParallelSlotsWaitCompletion(), AmcheckOptions::parent_check, pfree(), pg_fatal, pg_get_encoding_from_locale(), pg_log_error, pg_log_error_detail, pg_log_error_hint, pg_log_info, pg_log_warning, pg_logging_increase_verbosity(), pg_logging_init(), pg_strcasecmp(), pg_strdup(), PG_TEXTDOMAIN, _connParams::pghost, _connParams::pgport, PGRES_TUPLES_OK, _connParams::pguser, port, PQclear, PQdb(), PQerrorMessage(), PQERRORS_VERBOSE, PQescapeIdentifier(), PQfreemem(), PQgetvalue, PQntuples, PQresultStatus, PQsetErrorVerbosity(), prepare_btree_command(), prepare_heap_command(), progname, progress_report(), progress_since_last_stderr, _connParams::prompt_password, psprintf(), pstrdup(), SimplePtrListCell::ptr, AmcheckOptions::reconcile_toast, RelationInfo::relname, required_argument, AmcheckOptions::rootdescend, run_command(), set_pglocale_pgservice(), setup_cancel_handler(), AmcheckOptions::show_progress, AmcheckOptions::skip, RelationInfo::sql, AmcheckOptions::startblock, AmcheckOptions::strict_names, termPQExpBuffer(), TRI_DEFAULT, TRI_NO, TRI_YES, username, AmcheckOptions::verbose, verify_btree_slot_handler(), and verify_heap_slot_handler().
|
static |
Definition at line 883 of file pg_amcheck.c.
References DatabaseInfo::amcheck_schema, appendPQExpBuffer(), CppAsString2, RelationInfo::datinfo, fb(), AmcheckOptions::heapallindexed, DatabaseInfo::is_checkunique, opts, AmcheckOptions::parent_check, RelationInfo::reloid, resetPQExpBuffer(), and AmcheckOptions::rootdescend.
Referenced by main().
|
static |
Definition at line 843 of file pg_amcheck.c.
References DatabaseInfo::amcheck_schema, appendPQExpBuffer(), CppAsString2, RelationInfo::datinfo, AmcheckOptions::endblock, fb(), INT64_FORMAT, AmcheckOptions::on_error_stop, opts, AmcheckOptions::reconcile_toast, RelationInfo::reloid, resetPQExpBuffer(), AmcheckOptions::skip, and AmcheckOptions::startblock.
Referenced by main().
|
static |
Definition at line 1244 of file pg_amcheck.c.
References _, datname, fb(), fprintf, last_progress_report, now(), opts, progress_since_last_stderr, AmcheckOptions::show_progress, snprintf, UINT64_FORMAT, AmcheckOptions::verbose, and VERBOSE_DATNAME_LENGTH.
Referenced by main(), and write_target_range().
|
static |
Definition at line 932 of file pg_amcheck.c.
References ParallelSlot::connection, AmcheckOptions::echo, fb(), opts, pg_log_error, pg_log_error_detail, PQdb(), PQerrorMessage(), PQsendQuery(), and printf.
Referenced by main().
Definition at line 964 of file pg_amcheck.c.
References fb(), PG_DIAG_SEVERITY_NONLOCALIZED, PGRES_BAD_RESPONSE, PGRES_COMMAND_OK, PGRES_COPY_BOTH, PGRES_COPY_IN, PGRES_COPY_OUT, PGRES_EMPTY_QUERY, PGRES_FATAL_ERROR, PGRES_NONFATAL_ERROR, PGRES_PIPELINE_ABORTED, PGRES_PIPELINE_SYNC, PGRES_SINGLE_TUPLE, PGRES_TUPLES_CHUNK, PGRES_TUPLES_OK, PQresultErrorField, and PQresultStatus.
Referenced by verify_btree_slot_handler(), and verify_heap_slot_handler().
Definition at line 1120 of file pg_amcheck.c.
References _, all_checks_pass, conn, RelationInfo::datinfo, DatabaseInfo::datname, fb(), fprintf, FREE_AND_SET_NULL, indent_lines(), RelationInfo::nspname, opts, pg_log_warning, pg_log_warning_detail, pg_log_warning_hint, PGRES_TUPLES_OK, PQerrorMessage(), PQntuples, PQresultStatus, printf, progname, progress_since_last_stderr, RelationInfo::relname, should_processing_continue(), AmcheckOptions::show_progress, RelationInfo::sql, and AmcheckOptions::verbose.
Referenced by main().
Definition at line 1039 of file pg_amcheck.c.
References _, all_checks_pass, conn, RelationInfo::datinfo, DatabaseInfo::datname, FREE_AND_SET_NULL, i, indent_lines(), RelationInfo::nspname, opts, PGRES_TUPLES_OK, PQerrorMessage(), PQgetisnull, PQgetvalue, PQntuples, PQresultStatus, printf, RelationInfo::relname, should_processing_continue(), RelationInfo::sql, and AmcheckOptions::verbose.
Referenced by main().
Definition at line 144 of file pg_amcheck.c.
Referenced by main(), verify_btree_slot_handler(), and verify_heap_slot_handler().
Definition at line 173 of file pg_amcheck.c.
Referenced by main().
|
static |
Definition at line 147 of file pg_amcheck.c.
Referenced by progress_report(), progress_report(), and progress_report().
|
static |
Definition at line 112 of file pg_amcheck.c.
Referenced by AlterSubscription(), append_relation_pattern_helper(), append_schema_pattern(), ArchiveEntry(), BloomFillMetapage(), brin_bloom_add_value(), brin_bloom_get_ndistinct(), brin_minmax_multi_add_value(), brin_minmax_multi_get_values(), build_local_reloptions(), compile_database_list(), compile_relation_list_one_db(), copy_connection(), CopyFromGetRoutine(), CopyIndexAttOptions(), CopyToGetRoutine(), CreateSubscription(), get_attribute_options(), get_conninfo_value(), get_tablespace(), getFormattedTypeName(), initBloomState(), InitDumpOptions(), libpqrcv_check_conninfo(), libpqrcv_get_option_from_conninfo(), main(), main(), makeDefaultBloomOptions(), NewDumpOptions(), NewRestoreOptions(), parse_re_flags(), parse_subscription_options(), parse_test_flags(), prepare_btree_command(), prepare_heap_command(), progress_report(), read_restore_filters(), RelationGetIndexAttOptions(), run_command(), sql_exec_dumpalldbs(), sql_exec_dumpalltables(), sql_exec_dumpalltbspc(), sql_exec_searchtables(), test_protocol_version(), vacuum_rel(), verify_btree_slot_handler(), and verify_heap_slot_handler().
Definition at line 141 of file pg_amcheck.c.
Referenced by help(), main(), and verify_btree_slot_handler().
Definition at line 148 of file pg_amcheck.c.
Referenced by main(), progress_report(), and verify_btree_slot_handler().