|
PostgreSQL Source Code git master
|
#include "postgres_fe.h"#include "catalog/pg_authid_d.h"#include "catalog/pg_class_d.h"#include "fe_utils/string_utils.h"#include "pg_upgrade.h"#include "common/unicode_version.h"
Go to the source code of this file.
Data Structures | |
| struct | DataTypesUsageChecks |
| struct | data_type_check_state |
Macros | |
| #define | MANUAL_CHECK 1 |
| #define | ALL_VERSIONS -1 |
Variables | |
| static DataTypesUsageChecks | data_types_usage_checks [] |
| void check_and_dump_old_cluster | ( | void | ) |
Definition at line 590 of file check.c.
References UserOpts::check, check_for_connection_status(), check_for_data_types_usage(), check_for_incompatible_polymorphics(), check_for_isn_and_int8_passing_mismatch(), check_for_not_null_inheritance(), check_for_pg_role_prefix(), check_for_prepared_transactions(), check_for_tables_with_oids(), check_for_unicode_update(), check_for_user_defined_encoding_conversions(), check_for_user_defined_postfix_ops(), check_is_install_user(), check_old_cluster_for_valid_slots(), check_old_cluster_subscription_state(), generate_old_dump(), get_db_rel_and_slot_infos(), get_loadable_libraries(), GET_MAJOR_VERSION, get_subscription_info(), init_tablespaces(), UserOpts::live_check, ClusterInfo::major_version, old_9_6_invalidate_hash_indexes(), old_cluster, start_postmaster(), stop_postmaster(), and user_opts.
Referenced by main().
| void check_cluster_compatibility | ( | void | ) |
Definition at line 906 of file check.c.
References check_control_data(), ClusterInfo::controldata, get_control_data(), UserOpts::live_check, new_cluster, old_cluster, pg_fatal, ClusterInfo::port, and user_opts.
Referenced by main().
| void check_cluster_versions | ( | void | ) |
Definition at line 851 of file check.c.
References Assert(), ClusterInfo::bin_version, UserOpts::char_signedness, check_ok(), GET_MAJOR_VERSION, ClusterInfo::major_version, new_cluster, old_cluster, pg_fatal, prep_status(), and user_opts.
Referenced by main().
|
static |
Definition at line 1137 of file check.c.
References LogOpts::basedir, check_ok(), cluster(), connectToServer(), datallowconn, datconnlimit, datname, executeQueryOrDie(), fopen_priv, fprintf, log_opts, MAXPGPATH, pg_fatal, pg_log(), PG_REPORT, PQclear, PQfinish(), PQfnumber(), PQgetvalue, PQntuples, prep_status(), and snprintf.
Referenced by check_and_dump_old_cluster().
|
static |
Definition at line 465 of file check.c.
References ALL_VERSIONS, Assert(), data_type_check_state::check, check_ok(), cluster(), PQExpBufferData::data, data_type_check_query(), data_types_usage_checks, destroyPQExpBuffer(), GET_MAJOR_VERSION, i, MANUAL_CHECK, pg_fatal, pg_free(), pg_malloc0(), prep_status(), process_data_type_check(), data_type_check_state::report, DataTypesUsageChecks::status, DataTypesUsageChecks::threshold_version, upgrade_task_add_step(), upgrade_task_create(), upgrade_task_free(), upgrade_task_run(), and DataTypesUsageChecks::version_hook.
Referenced by check_and_dump_old_cluster().
|
static |
Definition at line 1470 of file check.c.
References appendPQExpBufferStr(), LogOpts::basedir, check_ok(), cluster(), PQExpBufferData::data, UpgradeTaskReport::file, GET_MAJOR_VERSION, initPQExpBuffer(), log_opts, UpgradeTaskReport::path, pg_fatal, pg_free(), pg_log(), PG_REPORT, prep_status(), process_incompat_polymorphics(), psprintf(), snprintf, termPQExpBuffer(), upgrade_task_add_step(), upgrade_task_create(), upgrade_task_free(), and upgrade_task_run().
Referenced by check_and_dump_old_cluster().
|
static |
Definition at line 1291 of file check.c.
References LogOpts::basedir, check_ok(), cluster(), ClusterInfo::controldata, UpgradeTaskReport::file, ControlData::float8_pass_by_value, log_opts, new_cluster, old_cluster, UpgradeTaskReport::path, pg_fatal, pg_log(), PG_REPORT, prep_status(), process_isn_and_int8_passing_mismatch(), snprintf, upgrade_task_add_step(), upgrade_task_create(), upgrade_task_free(), and upgrade_task_run().
Referenced by check_and_dump_old_cluster().
|
static |
Definition at line 952 of file check.c.
References check_ok(), MAXPGPATH, new_cluster, ClusterInfo::num_tablespaces, pg_fatal, prep_status(), snprintf, stat, ClusterInfo::tablespace_suffix, and ClusterInfo::tablespaces.
Referenced by check_new_cluster().
|
static |
Definition at line 1679 of file check.c.
References LogOpts::basedir, check_ok(), cluster(), UpgradeTaskReport::file, log_opts, UpgradeTaskReport::path, pg_fatal, pg_log(), PG_REPORT, prep_status(), process_inconsistent_notnull(), snprintf, upgrade_task_add_step(), upgrade_task_create(), upgrade_task_free(), and upgrade_task_run().
Referenced by check_and_dump_old_cluster().
|
static |
Definition at line 1730 of file check.c.
References LogOpts::basedir, check_ok(), cluster(), conn, connectToServer(), executeQueryOrDie(), fopen_priv, fprintf, log_opts, MAXPGPATH, pg_fatal, pg_log(), PG_REPORT, PQclear, PQfinish(), PQfnumber(), PQgetvalue, PQntuples, prep_status(), and snprintf.
Referenced by check_and_dump_old_cluster().
|
static |
Definition at line 1225 of file check.c.
References check_ok(), cluster(), conn, connectToServer(), executeQueryOrDie(), old_cluster, pg_fatal, PQclear, PQfinish(), PQntuples, and prep_status().
Referenced by check_and_dump_old_cluster(), and check_new_cluster().
|
static |
Definition at line 1599 of file check.c.
References LogOpts::basedir, check_ok(), cluster(), UpgradeTaskReport::file, log_opts, UpgradeTaskReport::path, pg_fatal, pg_log(), PG_REPORT, prep_status(), process_with_oids_check(), snprintf, upgrade_task_add_step(), upgrade_task_create(), upgrade_task_free(), and upgrade_task_run().
Referenced by check_and_dump_old_cluster().
|
static |
Definition at line 1925 of file check.c.
References LogOpts::basedir, check_ok(), cluster(), UpgradeTaskReport::file, GET_MAJOR_VERSION, log_opts, UpgradeTaskReport::path, pg_log(), PG_WARNING, prep_status(), process_unicode_update(), report_status(), snprintf, unicode_version_changed(), upgrade_task_add_step(), upgrade_task_create(), upgrade_task_free(), and upgrade_task_run().
Referenced by check_and_dump_old_cluster().
|
static |
Definition at line 1819 of file check.c.
References LogOpts::basedir, check_ok(), cluster(), UpgradeTaskReport::file, log_opts, UpgradeTaskReport::path, pg_fatal, pg_log(), PG_REPORT, prep_status(), process_user_defined_encoding_conversions(), snprintf, upgrade_task_add_step(), upgrade_task_create(), upgrade_task_free(), and upgrade_task_run().
Referenced by check_and_dump_old_cluster().
|
static |
Definition at line 1379 of file check.c.
References LogOpts::basedir, check_ok(), cluster(), UpgradeTaskReport::file, log_opts, UpgradeTaskReport::path, pg_fatal, pg_log(), PG_REPORT, prep_status(), process_user_defined_postfix_ops(), snprintf, upgrade_task_add_step(), upgrade_task_create(), upgrade_task_free(), and upgrade_task_run().
Referenced by check_and_dump_old_cluster().
|
static |
Definition at line 1079 of file check.c.
References atooid, check_ok(), cluster(), conn, connectToServer(), executeQueryOrDie(), new_cluster, os_info, pg_fatal, PQclear, PQfinish(), PQgetvalue, PQntuples, prep_status(), and OSInfo::user.
Referenced by check_and_dump_old_cluster(), and check_new_cluster().
| void check_new_cluster | ( | void | ) |
Definition at line 711 of file check.c.
References check_copy_file_range(), check_file_clone(), check_for_new_tablespace_dir(), check_for_prepared_transactions(), check_hard_link(), check_is_install_user(), check_loadable_libraries(), check_new_cluster_is_empty(), check_new_cluster_replication_slots(), check_new_cluster_subscription_configuration(), get_db_rel_and_slot_infos(), GET_MAJOR_VERSION, ClusterInfo::major_version, new_cluster, old_cluster, pg_fatal, UserOpts::transfer_mode, TRANSFER_MODE_CLONE, TRANSFER_MODE_COPY, TRANSFER_MODE_COPY_FILE_RANGE, TRANSFER_MODE_LINK, TRANSFER_MODE_SWAP, and user_opts.
Referenced by main().
|
static |
Definition at line 920 of file check.c.
References DbInfo::db_name, ClusterInfo::dbarr, DbInfoArr::dbs, DbInfoArr::ndbs, new_cluster, RelInfoArr::nrels, RelInfo::nspname, pg_fatal, DbInfo::rel_arr, RelInfo::relname, and RelInfoArr::rels.
Referenced by check_new_cluster().
|
static |
Definition at line 2059 of file check.c.
References Assert(), check_ok(), conn, connectToServer(), count_old_cluster_logical_slots(), executeQueryOrDie(), GET_MAJOR_VERSION, ClusterInfo::major_version, max_replication_slots, new_cluster, old_cluster, pg_fatal, PQclear, PQfinish(), PQfnumber(), PQgetvalue, PQntuples, prep_status(), ClusterInfo::sub_retain_dead_tuples, and wal_level.
Referenced by check_new_cluster().
|
static |
Definition at line 2171 of file check.c.
References check_ok(), conn, connectToServer(), executeQueryOrDie(), GET_MAJOR_VERSION, ClusterInfo::major_version, max_active_replication_origins, new_cluster, ClusterInfo::nsubs, old_cluster, pg_fatal, PQclear, PQfinish(), PQgetvalue, PQntuples, and prep_status().
Referenced by check_new_cluster().
|
static |
Definition at line 2214 of file check.c.
References LogOpts::basedir, LogicalSlotInfo::caught_up, check_ok(), ClusterInfo::dbarr, DbInfoArr::dbs, fopen_priv, fprintf, LogicalSlotInfo::invalid, UserOpts::live_check, log_opts, MAXPGPATH, DbInfoArr::ndbs, LogicalSlotInfoArr::nslots, old_cluster, pg_fatal, pg_log(), PG_REPORT, prep_status(), DbInfo::slot_arr, LogicalSlotInfo::slotname, LogicalSlotInfoArr::slots, snprintf, and user_opts.
Referenced by check_and_dump_old_cluster().
|
static |
Definition at line 2338 of file check.c.
References LogOpts::basedir, check_ok(), conn, connectToServer(), DbInfo::db_name, ClusterInfo::dbarr, DbInfoArr::dbs, executeQueryOrDie(), UpgradeTaskReport::file, fopen_priv, fprintf, i, log_opts, old_cluster, UpgradeTaskReport::path, pg_fatal, pg_log(), PG_REPORT, PQclear, PQfinish(), PQgetvalue, PQntuples, prep_status(), process_old_sub_state_check(), snprintf, upgrade_task_add_step(), upgrade_task_create(), upgrade_task_free(), and upgrade_task_run().
Referenced by check_and_dump_old_cluster().
| void create_script_for_old_cluster_deletion | ( | char ** | deletion_script_file_name | ) |
Definition at line 981 of file check.c.
References canonicalize_path(), check_ok(), fix_path_separator(), fopen_priv, fprintf, MAXPGPATH, new_cluster, ClusterInfo::num_tablespaces, old_cluster, path_is_prefix_of_path(), PATH_QUOTE, pfree(), pg_fatal, pg_free(), pg_log(), pg_strdup(), PG_WARNING, ClusterInfo::pgdata, prep_status(), psprintf(), RMDIR_CMD, S_IRWXU, SCRIPT_EXT, SCRIPT_PREFIX, strlcpy(), ClusterInfo::tablespace_suffix, and ClusterInfo::tablespaces.
Referenced by main().
|
static |
Definition at line 334 of file check.c.
References DataTypesUsageChecks::base_query, CppAsString2, data_types_usage_checks, and psprintf().
Referenced by check_for_data_types_usage().
|
static |
Definition at line 551 of file check.c.
References pg_strdup(), and data_type_check_state::result.
Referenced by create_script_for_old_cluster_deletion().
| void issue_warnings_and_set_wal_level | ( | void | ) |
Definition at line 793 of file check.c.
References GET_MAJOR_VERSION, ClusterInfo::major_version, new_cluster, old_9_6_invalidate_hash_indexes(), old_cluster, report_extension_updates(), start_postmaster(), and stop_postmaster().
Referenced by main().
| void output_check_banner | ( | void | ) |
Definition at line 572 of file check.c.
References UserOpts::live_check, pg_log(), PG_REPORT, and user_opts.
Referenced by main().
| void output_completion_banner | ( | char * | deletion_script_file_name | ) |
Definition at line 814 of file check.c.
References appendPQExpBufferChar(), appendPQExpBufferStr(), appendShellString(), ClusterInfo::bindir, PQExpBufferData::data, initPQExpBuffer(), new_cluster, os_info, pg_log(), PG_REPORT, termPQExpBuffer(), OSInfo::user, and OSInfo::user_specified.
Referenced by main().
Definition at line 391 of file check.c.
References _, appendPQExpBuffer(), arg, AssertVariableIsOfType, LogOpts::basedir, createPQExpBuffer(), DbInfo::db_name, fopen_priv, fprintf, log_opts, MAXPGPATH, pg_fatal, pg_log(), PG_REPORT, PQfnumber(), PQgetvalue, PQntuples, process_data_type_check(), and snprintf.
Referenced by check_for_data_types_usage(), and process_data_type_check().
Definition at line 1438 of file check.c.
References arg, AssertVariableIsOfType, DbInfo::db_name, UpgradeTaskReport::file, fopen_priv, fprintf, UpgradeTaskReport::path, pg_fatal, PQfnumber(), PQgetvalue, PQntuples, and process_incompat_polymorphics().
Referenced by check_for_incompatible_polymorphics(), and process_incompat_polymorphics().
Definition at line 1641 of file check.c.
References arg, AssertVariableIsOfType, DbInfo::db_name, UpgradeTaskReport::file, fopen_priv, fprintf, UpgradeTaskReport::path, pg_fatal, PQfnumber(), PQgetvalue, PQntuples, and process_inconsistent_notnull().
Referenced by check_for_not_null_inheritance(), and process_inconsistent_notnull().
|
static |
Definition at line 1258 of file check.c.
References arg, AssertVariableIsOfType, DbInfo::db_name, UpgradeTaskReport::file, fopen_priv, fprintf, UpgradeTaskReport::path, pg_fatal, PQfnumber(), PQgetvalue, PQntuples, and process_isn_and_int8_passing_mismatch().
Referenced by check_for_isn_and_int8_passing_mismatch(), and process_isn_and_int8_passing_mismatch().
Definition at line 2303 of file check.c.
References arg, AssertVariableIsOfType, DbInfo::db_name, UpgradeTaskReport::file, fopen_priv, fprintf, i, UpgradeTaskReport::path, pg_fatal, PQfnumber(), PQgetvalue, PQntuples, and process_old_sub_state_check().
Referenced by check_old_cluster_subscription_state(), and process_old_sub_state_check().
Definition at line 1871 of file check.c.
References arg, DbInfo::db_name, UpgradeTaskReport::file, fopen_priv, fprintf, UpgradeTaskReport::path, pg_fatal, PQfnumber(), PQgetvalue, and PQntuples.
Referenced by check_for_unicode_update().
|
static |
Definition at line 1788 of file check.c.
References arg, AssertVariableIsOfType, DbInfo::db_name, UpgradeTaskReport::file, fopen_priv, fprintf, UpgradeTaskReport::path, pg_fatal, PQfnumber(), PQgetvalue, PQntuples, and process_user_defined_encoding_conversions().
Referenced by check_for_user_defined_encoding_conversions(), and process_user_defined_encoding_conversions().
Definition at line 1344 of file check.c.
References arg, AssertVariableIsOfType, DbInfo::db_name, UpgradeTaskReport::file, fopen_priv, fprintf, UpgradeTaskReport::path, pg_fatal, PQfnumber(), PQgetvalue, PQntuples, and process_user_defined_postfix_ops().
Referenced by check_for_user_defined_postfix_ops(), and process_user_defined_postfix_ops().
Definition at line 1571 of file check.c.
References arg, AssertVariableIsOfType, DbInfo::db_name, UpgradeTaskReport::file, fopen_priv, fprintf, UpgradeTaskReport::path, pg_fatal, PQfnumber(), PQgetvalue, PQntuples, and process_with_oids_check().
Referenced by check_for_tables_with_oids(), and process_with_oids_check().
| void report_clusters_compatible | ( | void | ) |
Definition at line 774 of file check.c.
References UserOpts::check, cleanup_output_dirs(), pg_log(), PG_REPORT, stop_postmaster(), and user_opts.
Referenced by main().
|
static |
Definition at line 1900 of file check.c.
References cluster(), connectToServer(), executeQueryOrDie(), PG_UNICODE_VERSION, PQclear, PQfinish(), and PQgetvalue.
Referenced by check_for_unicode_update().
|
static |
Definition at line 98 of file check.c.
Referenced by check_for_data_types_usage(), and data_type_check_query().