|
PostgreSQL Source Code git master
|
#include "postgres_fe.h"#include "catalog/pg_am_d.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 [] |
Definition at line 590 of file check.c.
References UserOpts::check, check_for_connection_status(), check_for_data_types_usage(), check_for_gist_inet_ops(), 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().
Definition at line 921 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().
Definition at line 866 of file check.c.
References Assert, ClusterInfo::bin_version, UserOpts::char_signedness, check_ok(), fb(), GET_MAJOR_VERSION, ClusterInfo::major_version, new_cluster, old_cluster, pg_fatal, prep_status(), and user_opts.
Referenced by main().
|
static |
Definition at line 1152 of file check.c.
References LogOpts::basedir, check_ok(), cluster(), connectToServer(), datallowconn, datconnlimit, datname, executeQueryOrDie(), fb(), 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(), fb(), 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 1759 of file check.c.
References LogOpts::basedir, check_ok(), cluster(), CppAsString2, fb(), UpgradeTaskReport::file, log_opts, UpgradeTaskReport::path, pg_fatal, pg_log(), PG_REPORT, prep_status(), process_gist_inet_ops_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 1476 of file check.c.
References appendPQExpBufferStr(), LogOpts::basedir, check_ok(), cluster(), fb(), 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 1303 of file check.c.
References LogOpts::basedir, check_ok(), cluster(), ClusterInfo::controldata, fb(), 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().
Definition at line 967 of file check.c.
References check_ok(), fb(), 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 1680 of file check.c.
References LogOpts::basedir, check_ok(), cluster(), fb(), 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 1805 of file check.c.
References LogOpts::basedir, check_ok(), cluster(), conn, connectToServer(), executeQueryOrDie(), fb(), 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 1240 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 1603 of file check.c.
References LogOpts::basedir, check_ok(), cluster(), fb(), 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 1997 of file check.c.
References LogOpts::basedir, check_ok(), cluster(), fb(), 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 1891 of file check.c.
References LogOpts::basedir, check_ok(), cluster(), fb(), 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 1388 of file check.c.
References LogOpts::basedir, check_ok(), cluster(), fb(), 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 1094 of file check.c.
References atooid, check_ok(), cluster(), conn, connectToServer(), executeQueryOrDie(), fb(), 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().
Definition at line 726 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().
Definition at line 935 of file check.c.
References DbInfo::db_name, ClusterInfo::dbarr, DbInfoArr::dbs, fb(), DbInfoArr::ndbs, new_cluster, RelInfoArr::nrels, RelInfo::nspname, pg_fatal, DbInfo::rel_arr, RelInfo::relname, and RelInfoArr::rels.
Referenced by check_new_cluster().
Definition at line 2131 of file check.c.
References Assert, check_ok(), conn, connectToServer(), count_old_cluster_logical_slots(), executeQueryOrDie(), fb(), 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().
Definition at line 2239 of file check.c.
References check_ok(), conn, connectToServer(), executeQueryOrDie(), fb(), 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().
Definition at line 2282 of file check.c.
References LogOpts::basedir, LogicalSlotInfo::caught_up, check_ok(), ClusterInfo::dbarr, DbInfoArr::dbs, fb(), 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().
Definition at line 2404 of file check.c.
References LogOpts::basedir, check_ok(), conn, connectToServer(), DbInfo::db_name, ClusterInfo::dbarr, DbInfoArr::dbs, executeQueryOrDie(), fb(), 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().
Definition at line 996 of file check.c.
References canonicalize_path(), check_ok(), fb(), 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().
Definition at line 336 of file check.c.
References DataTypesUsageChecks::base_query, CppAsString2, data_types_usage_checks, fb(), and psprintf().
Referenced by check_for_data_types_usage().
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().
Definition at line 808 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().
Definition at line 572 of file check.c.
References UserOpts::live_check, pg_log(), PG_REPORT, and user_opts.
Referenced by main().
Definition at line 829 of file check.c.
References appendPQExpBufferChar(), appendPQExpBufferStr(), appendShellString(), ClusterInfo::bindir, fb(), initPQExpBuffer(), new_cluster, os_info, pg_log(), PG_REPORT, termPQExpBuffer(), OSInfo::user, and OSInfo::user_specified.
Referenced by main().
Definition at line 393 of file check.c.
References _, appendPQExpBuffer(), arg, LogOpts::basedir, createPQExpBuffer(), DbInfo::db_name, fb(), fopen_priv, fprintf, log_opts, MAXPGPATH, pg_fatal, pg_log(), PG_REPORT, PQfnumber(), PQgetvalue, PQntuples, and snprintf.
Referenced by check_for_data_types_usage().
Definition at line 1731 of file check.c.
References arg, DbInfo::db_name, fb(), UpgradeTaskReport::file, fopen_priv, fprintf, UpgradeTaskReport::path, pg_fatal, PQfnumber(), PQgetvalue, and PQntuples.
Referenced by check_for_gist_inet_ops().
Definition at line 1447 of file check.c.
References arg, DbInfo::db_name, fb(), UpgradeTaskReport::file, fopen_priv, fprintf, UpgradeTaskReport::path, pg_fatal, PQfnumber(), PQgetvalue, and PQntuples.
Referenced by check_for_incompatible_polymorphics().
Definition at line 1645 of file check.c.
References arg, DbInfo::db_name, fb(), UpgradeTaskReport::file, fopen_priv, fprintf, UpgradeTaskReport::path, pg_fatal, PQfnumber(), PQgetvalue, and PQntuples.
Referenced by check_for_not_null_inheritance().
|
static |
Definition at line 1273 of file check.c.
References arg, DbInfo::db_name, fb(), UpgradeTaskReport::file, fopen_priv, fprintf, UpgradeTaskReport::path, pg_fatal, PQfnumber(), PQgetvalue, and PQntuples.
Referenced by check_for_isn_and_int8_passing_mismatch().
Definition at line 2371 of file check.c.
References arg, DbInfo::db_name, fb(), UpgradeTaskReport::file, fopen_priv, fprintf, i, UpgradeTaskReport::path, pg_fatal, PQfnumber(), PQgetvalue, and PQntuples.
Referenced by check_old_cluster_subscription_state().
Definition at line 1943 of file check.c.
References arg, DbInfo::db_name, fb(), UpgradeTaskReport::file, fopen_priv, fprintf, UpgradeTaskReport::path, pg_fatal, PQfnumber(), PQgetvalue, and PQntuples.
Referenced by check_for_unicode_update().
|
static |
Definition at line 1863 of file check.c.
References arg, DbInfo::db_name, fb(), UpgradeTaskReport::file, fopen_priv, fprintf, UpgradeTaskReport::path, pg_fatal, PQfnumber(), PQgetvalue, and PQntuples.
Referenced by check_for_user_defined_encoding_conversions().
Definition at line 1356 of file check.c.
References arg, DbInfo::db_name, fb(), UpgradeTaskReport::file, fopen_priv, fprintf, UpgradeTaskReport::path, pg_fatal, PQfnumber(), PQgetvalue, and PQntuples.
Referenced by check_for_user_defined_postfix_ops().
Definition at line 1577 of file check.c.
References arg, DbInfo::db_name, fb(), UpgradeTaskReport::file, fopen_priv, fprintf, UpgradeTaskReport::path, pg_fatal, PQfnumber(), PQgetvalue, and PQntuples.
Referenced by check_for_tables_with_oids().
Definition at line 789 of file check.c.
References UserOpts::check, cleanup_output_dirs(), fb(), pg_log(), PG_REPORT, stop_postmaster(), and user_opts.
Referenced by main().
|
static |
Definition at line 1972 of file check.c.
References cluster(), connectToServer(), executeQueryOrDie(), fb(), PG_UNICODE_VERSION, PQclear, PQfinish(), and PQgetvalue.
Referenced by check_for_unicode_update().
|
static |
Definition at line 100 of file check.c.
Referenced by check_for_data_types_usage(), and data_type_check_query().