|
PostgreSQL Source Code git master
|
#include <unistd.h>#include <assert.h>#include <sys/stat.h>#include <sys/time.h>#include "common/relpath.h"#include "libpq-fe.h"

Go to the source code of this file.
Data Structures | |
| struct | RelInfo |
| struct | RelInfoArr |
| struct | LogicalSlotInfo |
| struct | LogicalSlotInfoArr |
| struct | FileNameMap |
| struct | DbInfo |
| struct | DbLocaleInfo |
| struct | DbInfoArr |
| struct | ControlData |
| struct | ClusterInfo |
| struct | LogOpts |
| struct | UserOpts |
| struct | LibraryInfo |
| struct | OSInfo |
| struct | UpgradeTaskReport |
Typedefs | |
| typedef bool(* | DataTypesUsageVersionCheck) (ClusterInfo *cluster) |
| typedef void(* | UpgradeTaskProcessCB) (DbInfo *dbinfo, PGresult *res, void *arg) |
| typedef struct UpgradeTask | UpgradeTask |
Enumerations | |
| enum | transferMode { TRANSFER_MODE_CLONE , TRANSFER_MODE_COPY , TRANSFER_MODE_COPY_FILE_RANGE , TRANSFER_MODE_LINK , TRANSFER_MODE_SWAP } |
| enum | eLogType { PG_VERBOSE , PG_STATUS , PG_REPORT_NONL , PG_REPORT , PG_WARNING , PG_FATAL } |
Variables | |
| char * | output_files [] |
| LogOpts | log_opts |
| UserOpts | user_opts |
| ClusterInfo | old_cluster |
| ClusterInfo | new_cluster |
| OSInfo | os_info |
| #define BASE_OUTPUTDIR "pg_upgrade_output.d" |
Definition at line 39 of file pg_upgrade.h.
Definition at line 31 of file pg_upgrade.h.
Definition at line 43 of file pg_upgrade.h.
| #define DEF_PGUPORT 50432 |
Definition at line 20 of file pg_upgrade.h.
| #define DEFAULT_CHAR_SIGNEDNESS_CAT_VER 202502212 |
Definition at line 139 of file pg_upgrade.h.
| #define DUMP_OUTPUTDIR "dump" |
Definition at line 41 of file pg_upgrade.h.
| #define ECHO_BLANK "" |
Definition at line 89 of file pg_upgrade.h.
| #define ECHO_QUOTE "'" |
Definition at line 88 of file pg_upgrade.h.
| #define EXEC_PSQL_ARGS "--echo-queries --set ON_ERROR_STOP=on --no-psqlrc --dbname=template1" |
Definition at line 414 of file pg_upgrade.h.
| #define GET_MAJOR_VERSION | ( | v | ) | ((v) / 100) |
Definition at line 27 of file pg_upgrade.h.
| #define GLOBALS_DUMP_FILE "pg_upgrade_dump_globals.sql" |
Definition at line 30 of file pg_upgrade.h.
| #define INTERNAL_LOG_FILE "pg_upgrade_internal.log" |
Definition at line 46 of file pg_upgrade.h.
| #define JSONB_FORMAT_CHANGE_CAT_VER 201409291 |
Definition at line 133 of file pg_upgrade.h.
| #define LARGE_OBJECT_SIZE_PG_CONTROL_VER 942 |
Definition at line 128 of file pg_upgrade.h.
| #define LOG_OUTPUTDIR "log" |
Definition at line 40 of file pg_upgrade.h.
| #define MAX_STRING 1024 |
Definition at line 22 of file pg_upgrade.h.
| #define MESSAGE_WIDTH 62 |
Definition at line 25 of file pg_upgrade.h.
| #define MULTIXACT_FORMATCHANGE_CAT_VER 201301231 |
Definition at line 115 of file pg_upgrade.h.
| #define MULTIXACTOFFSET_FORMATCHANGE_CAT_VER 202512091 |
Definition at line 122 of file pg_upgrade.h.
| #define PATH_QUOTE '\'' |
Definition at line 83 of file pg_upgrade.h.
| #define PATH_SEPARATOR '/' |
Definition at line 82 of file pg_upgrade.h.
Definition at line 81 of file pg_upgrade.h.
| #define QUERY_ALLOC 8192 |
Definition at line 23 of file pg_upgrade.h.
Definition at line 84 of file pg_upgrade.h.
Definition at line 85 of file pg_upgrade.h.
| #define SCRIPT_EXT "sh" |
Definition at line 87 of file pg_upgrade.h.
| #define SCRIPT_PREFIX "./" |
Definition at line 86 of file pg_upgrade.h.
| #define SERVER_LOG_FILE "pg_upgrade_server.log" |
Definition at line 44 of file pg_upgrade.h.
| #define SERVER_START_LOG_FILE SERVER_LOG_FILE |
Definition at line 67 of file pg_upgrade.h.
| #define SERVER_STOP_LOG_FILE SERVER_LOG_FILE |
Definition at line 68 of file pg_upgrade.h.
| #define UTILITY_LOG_FILE "pg_upgrade_utility.log" |
Definition at line 45 of file pg_upgrade.h.
| #define VISIBILITY_MAP_FROZEN_BIT_CAT_VER 201603011 |
Definition at line 107 of file pg_upgrade.h.
| typedef bool(* DataTypesUsageVersionCheck) (ClusterInfo *cluster) |
Definition at line 375 of file pg_upgrade.h.
Definition at line 525 of file pg_upgrade.h.
Definition at line 522 of file pg_upgrade.h.
| Enumerator | |
|---|---|
| PG_VERBOSE | |
| PG_STATUS | |
| PG_REPORT_NONL | |
| PG_REPORT | |
| PG_WARNING | |
| PG_FATAL | |
Definition at line 278 of file pg_upgrade.h.
| Enumerator | |
|---|---|
| TRANSFER_MODE_CLONE | |
| TRANSFER_MODE_COPY | |
| TRANSFER_MODE_COPY_FILE_RANGE | |
| TRANSFER_MODE_LINK | |
| TRANSFER_MODE_SWAP | |
Definition at line 266 of file pg_upgrade.h.
| void adjust_data_dir | ( | ClusterInfo * | cluster | ) |
Definition at line 430 of file option.c.
References check_ok(), cluster(), fb(), filename, MAX_STRING, MAXPGPATH, old_cluster, output, pg_fatal, pg_strdup(), pg_strip_crlf(), prep_status(), snprintf, and wait_result_to_str().
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().
| void check_control_data | ( | ControlData * | oldctrl, |
| ControlData * | newctrl | ||
| ) |
Definition at line 698 of file controldata.c.
References fb(), and pg_fatal.
Referenced by check_cluster_compatibility().
Definition at line 400 of file file.c.
References close, fb(), MAXPGPATH, new_cluster, old_cluster, PG_BINARY, pg_fatal, pg_file_create_mode, ClusterInfo::pgdata, and snprintf.
Referenced by check_new_cluster().
Definition at line 360 of file file.c.
References close, fb(), MAXPGPATH, new_cluster, old_cluster, PG_BINARY, pg_fatal, pg_file_create_mode, ClusterInfo::pgdata, and snprintf.
Referenced by check_new_cluster().
| void check_hard_link | ( | transferMode | transfer_mode | ) |
Definition at line 437 of file file.c.
References fb(), MAXPGPATH, new_cluster, old_cluster, pg_fatal, ClusterInfo::pgdata, snprintf, TRANSFER_MODE_LINK, and TRANSFER_MODE_SWAP.
Referenced by check_new_cluster().
Definition at line 163 of file function.c.
References _, LogOpts::basedir, check_ok(), conn, connectToServer(), DbInfo::db_name, ClusterInfo::dbarr, LibraryInfo::dbnum, DbInfoArr::dbs, fb(), fopen_priv, fprintf, OSInfo::libraries, library_name_compare(), log_opts, MAXPGPATH, LibraryInfo::name, new_cluster, OSInfo::num_libraries, old_cluster, os_info, pg_fatal, pg_log(), PG_REPORT, PGRES_COMMAND_OK, PQclear, PQerrorMessage(), PQescapeStringConn(), PQexec(), PQfinish(), PQresultStatus, prep_status(), qsort, and snprintf.
Referenced by 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 284 of file util.c.
References PG_REPORT, and report_status().
Definition at line 319 of file server.c.
References fb(), is_unixsock_path(), pg_fatal, PQconndefaults(), PQconninfoFree(), start, and value.
Referenced by setup().
Definition at line 63 of file util.c.
References Assert, LogOpts::basedir, fb(), LogOpts::internal, log_opts, pg_check_dir(), pg_log(), PG_WARNING, LogOpts::retain, rmtree(), and LogOpts::rootdir.
Referenced by main(), and report_clusters_compatible().
| void cloneFile | ( | const char * | src, |
| const char * | dst, | ||
| const char * | schemaName, | ||
| const char * | relName | ||
| ) |
Definition at line 39 of file file.c.
References close, fb(), PG_BINARY, pg_fatal, pg_file_create_mode, and strerror.
Referenced by transfer_relfile().
| PGresult char * cluster_conn_opts | ( | ClusterInfo * | cluster | ) |
Definition at line 92 of file server.c.
References appendPQExpBuffer(), appendPQExpBufferChar(), appendPQExpBufferStr(), appendShellString(), buf, cluster(), createPQExpBuffer(), fb(), os_info, resetPQExpBuffer(), and OSInfo::user.
Referenced by create_new_objects(), generate_old_dump(), prepare_new_cluster(), and prepare_new_globals().
| PGconn * connectToServer | ( | ClusterInfo * | cluster, |
| const char * | db_name | ||
| ) |
Definition at line 28 of file server.c.
References _, ALWAYS_SECURE_SEARCH_PATH_SQL, cluster(), conn, CONNECTION_OK, executeQueryOrDie(), fb(), get_db_conn(), pg_log(), PG_REPORT, PQclear, PQerrorMessage(), PQfinish(), PQstatus(), and printf.
Referenced by check_for_connection_status(), check_for_pg_role_prefix(), check_for_prepared_transactions(), check_is_install_user(), check_loadable_libraries(), check_new_cluster_replication_slots(), check_new_cluster_subscription_configuration(), check_old_cluster_subscription_state(), create_conflict_detection_slot(), create_logical_replication_slots(), create_new_objects(), get_db_infos(), get_subscription_info(), get_tablespace_paths(), get_template0_info(), old_9_6_invalidate_hash_indexes(), set_frozenxids(), set_locale_and_encoding(), and unicode_version_changed().
Definition at line 82 of file file.c.
References _dosmaperr(), close, COPY_BUF_SIZE, fb(), PG_BINARY, pg_fatal, pg_file_create_mode, pg_free(), pg_malloc(), read, and write.
Referenced by transfer_relfile().
| void copyFileByRange | ( | const char * | src, |
| const char * | dst, | ||
| const char * | schemaName, | ||
| const char * | relName | ||
| ) |
Definition at line 151 of file file.c.
References close, fb(), PG_BINARY, pg_fatal, and pg_file_create_mode.
Referenced by transfer_relfile().
Definition at line 774 of file info.c.
References ClusterInfo::dbarr, DbInfoArr::dbs, fb(), DbInfoArr::ndbs, LogicalSlotInfoArr::nslots, old_cluster, and DbInfo::slot_arr.
Referenced by check_new_cluster_replication_slots(), get_loadable_libraries(), and main().
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().
| void disable_old_cluster | ( | transferMode | transfer_mode | ) |
Definition at line 755 of file controldata.c.
References check_ok(), fb(), MAXPGPATH, old_cluster, pg_fatal, pg_log(), pg_mv_file, PG_REPORT, ClusterInfo::pgdata, prep_status(), snprintf, TRANSFER_MODE_LINK, TRANSFER_MODE_SWAP, and XLOG_CONTROL_FILE.
Referenced by main().
Definition at line 43 of file util.c.
References LogOpts::isatty, log_opts, MESSAGE_WIDTH, pg_log(), PG_REPORT_NONL, printf, and LogOpts::verbose.
Referenced by create_logical_replication_slots(), create_new_objects(), generate_old_dump(), and transfer_all_new_tablespaces().
| bool exec_prog | ( | const char * | log_filename, |
| const char * | opt_log_file, | ||
| bool | report_error, | ||
| bool | exit_on_error, | ||
| const char * | fmt, | ||
| ... | |||
| ) |
Referenced by check_for_connection_status(), check_for_pg_role_prefix(), check_for_prepared_transactions(), check_is_install_user(), check_new_cluster_replication_slots(), check_new_cluster_subscription_configuration(), check_old_cluster_subscription_state(), create_conflict_detection_slot(), create_logical_replication_slots(), create_new_objects(), get_db_infos(), get_subscription_info(), get_tablespace_paths(), get_template0_info(), old_9_6_invalidate_hash_indexes(), set_frozenxids(), set_locale_and_encoding(), and unicode_version_changed().
| FileNameMap * gen_db_file_maps | ( | DbInfo * | old_db, |
| DbInfo * | new_db, | ||
| int * | nmaps, | ||
| const char * | old_pgdata, | ||
| const char * | new_pgdata | ||
| ) |
Definition at line 45 of file info.c.
References create_rel_filename_map(), fb(), maps, pg_fatal, pg_log(), pg_malloc(), PG_WARNING, and report_unmatched_relation().
Referenced by transfer_all_new_dbs().
Definition at line 16 of file dump.c.
References appendConnStrVal(), appendPQExpBufferStr(), appendShellString(), ClusterInfo::bindir, check_ok(), cluster_conn_opts(), connstr, DB_DUMP_FILE_MASK, DB_DUMP_LOG_FILE_MASK, ClusterInfo::dbarr, DbInfoArr::dbs, UserOpts::do_statistics, LogOpts::dumpdir, end_progress_output(), exec_prog(), fb(), GLOBALS_DUMP_FILE, initPQExpBuffer(), log_opts, MAXPGPATH, DbInfoArr::ndbs, new_cluster, old_cluster, parallel_exec_prog(), pg_log(), PG_STATUS, prep_status(), prep_status_progress(), reap_child(), snprintf, termPQExpBuffer(), UserOpts::transfer_mode, TRANSFER_MODE_SWAP, user_opts, UTILITY_LOG_FILE, and LogOpts::verbose.
Referenced by check_and_dump_old_cluster().
| void get_control_data | ( | ClusterInfo * | cluster | ) |
Definition at line 38 of file controldata.c.
References Assert, cluster(), DEFAULT_CHAR_SIGNEDNESS_CAT_VER, fb(), GET_MAJOR_VERSION, LARGE_OBJECT_SIZE_PG_CONTROL_VER, lc_collate, lc_ctype, lc_messages, lc_monetary, lc_numeric, lc_time, UserOpts::live_check, MAX_STRING, MAXPGPATH, MULTIXACT_FORMATCHANGE_CAT_VER, new_cluster, old_cluster, output, pg_fatal, pg_free(), pg_log(), PG_REPORT, pg_strdup(), pg_strip_crlf(), PG_VERBOSE, setenv, snprintf, str2uint(), strlcpy(), unsetenv, user_opts, and wait_result_to_str().
Referenced by check_cluster_compatibility().
| void get_db_rel_and_slot_infos | ( | ClusterInfo * | cluster | ) |
Definition at line 280 of file info.c.
References cluster(), fb(), free_db_and_rel_infos(), get_db_infos(), GET_MAJOR_VERSION, get_old_cluster_logical_slot_infos_query(), get_rel_infos_query(), get_template0_info(), log_opts, old_cluster, pg_free(), pg_log(), PG_VERBOSE, print_db_infos(), process_old_cluster_logical_slot_infos(), process_rel_infos(), upgrade_task_add_step(), upgrade_task_create(), upgrade_task_free(), upgrade_task_run(), and LogOpts::verbose.
Referenced by check_and_dump_old_cluster(), check_new_cluster(), and create_new_objects().
Definition at line 77 of file function.c.
References count_old_cluster_logical_slots(), ClusterInfo::dbarr, LibraryInfo::dbnum, DbInfoArr::dbs, fb(), FirstNormalObjectId, LogicalSlotInfo::invalid, OSInfo::libraries, LibraryInfo::name, DbInfoArr::ndbs, LogicalSlotInfoArr::nslots, OSInfo::num_libraries, old_cluster, os_info, pg_free(), pg_malloc(), pg_strdup(), LogicalSlotInfo::plugin, PQclear, PQgetvalue, PQntuples, process_loadable_libraries(), psprintf(), DbInfo::slot_arr, LogicalSlotInfoArr::slots, loadable_libraries_state::totaltups, upgrade_task_add_step(), upgrade_task_create(), upgrade_task_free(), and upgrade_task_run().
Referenced by check_and_dump_old_cluster().
| void get_sock_dir | ( | ClusterInfo * | cluster | ) |
Definition at line 499 of file option.c.
References cluster(), DEF_PGUPORT, fb(), filename, UserOpts::live_check, LOCK_FILE_LINE_PORT, LOCK_FILE_LINE_SOCKET_DIR, Max, MAXPGPATH, new_cluster, old_cluster, pg_fatal, pg_log(), pg_strdup(), pg_strip_crlf(), PG_WARNING, ClusterInfo::port, snprintf, UserOpts::socketdir, and user_opts.
Referenced by main().
| void get_subscription_info | ( | ClusterInfo * | cluster | ) |
Definition at line 790 of file info.c.
References cluster(), conn, connectToServer(), executeQueryOrDie(), fb(), GET_MAJOR_VERSION, PQclear, PQfinish(), PQfnumber(), and PQgetvalue.
Referenced by check_and_dump_old_cluster().
Definition at line 323 of file util.c.
References fb(), get_user_name(), pg_fatal, and pg_strdup().
Referenced by parseCommandLine().
Definition at line 19 of file tablespace.c.
References fb(), get_tablespace_paths(), i, new_cluster, ClusterInfo::num_tablespaces, old_cluster, pg_fatal, set_tablespace_directory_suffix(), ClusterInfo::tablespace_suffix, and ClusterInfo::tablespaces.
Referenced by check_and_dump_old_cluster().
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().
| bool jsonb_9_4_check_applicable | ( | ClusterInfo * | cluster | ) |
Definition at line 21 of file version.c.
References cluster(), GET_MAJOR_VERSION, and JSONB_FORMAT_CHANGE_CAT_VER.
| void old_9_6_invalidate_hash_indexes | ( | ClusterInfo * | cluster, |
| bool | check_mode | ||
| ) |
Definition at line 37 of file version.c.
References appendPsqlMetaConnect(), check_ok(), cluster(), conn, connectToServer(), executeQueryOrDie(), fb(), fopen_priv, fprintf, initPQExpBuffer(), pg_fatal, pg_log(), PG_WARNING, PQclear, PQfinish(), PQfnumber(), PQgetvalue, PQntuples, prep_status(), quote_identifier(), report_status(), and termPQExpBuffer().
Referenced by check_and_dump_old_cluster(), and issue_warnings_and_set_wal_level().
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().
| void void parallel_transfer_all_new_dbs | ( | DbInfoArr * | old_db_arr, |
| DbInfoArr * | new_db_arr, | ||
| char * | old_pgdata, | ||
| char * | new_pgdata, | ||
| char * | old_tablespace, | ||
| char * | new_tablespace | ||
| ) |
Definition at line 173 of file parallel.c.
References fb(), i, UserOpts::jobs, parallel_jobs, pg_fatal, pg_free(), pg_malloc(), pg_malloc0(), pg_strdup(), reap_child(), transfer_all_new_dbs(), and user_opts.
Referenced by transfer_all_new_tablespaces().
Definition at line 39 of file option.c.
References _, ClusterInfo::bindir, canonicalize_path(), UserOpts::char_signedness, UserOpts::check, check_required_directory(), DEF_PGUPORT, UserOpts::do_statistics, UserOpts::do_sync, fb(), FIX_DEFAULT_READ_ONLY, fprintf, free, get_progname(), get_user_info(), getopt_long(), LogOpts::isatty, UserOpts::jobs, log_opts, MAXPGPATH, new_cluster, no_argument, old_cluster, optarg, optind, os_info, parse_sync_method(), path_is_prefix_of_path(), pfree(), pg_fatal, pg_free(), pg_log(), PG_REPORT, pg_strcasecmp(), pg_strdup(), ClusterInfo::pgdata, ClusterInfo::pgopts, ClusterInfo::port, OSInfo::progname, psprintf(), required_argument, LogOpts::retain, setenv, UserOpts::socketdir, strlcpy(), UserOpts::sync_method, UserOpts::transfer_mode, TRANSFER_MODE_CLONE, TRANSFER_MODE_COPY, TRANSFER_MODE_COPY_FILE_RANGE, TRANSFER_MODE_LINK, TRANSFER_MODE_SWAP, usage(), OSInfo::user, user_opts, OSInfo::user_specified, and LogOpts::verbose.
Referenced by main().
Referenced by check_for_connection_status(), 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_tables_with_oids(), check_for_unicode_update(), check_for_user_defined_encoding_conversions(), check_for_user_defined_postfix_ops(), check_loadable_libraries(), check_old_cluster_for_valid_slots(), check_old_cluster_subscription_state(), connectToServer(), create_logical_replication_slots(), create_new_objects(), create_script_for_old_cluster_deletion(), disable_old_cluster(), exec_prog(), executeQueryOrDie(), gen_db_file_maps(), generate_old_dump(), get_control_data(), get_db_rel_and_slot_infos(), get_sock_dir(), main(), old_9_6_invalidate_hash_indexes(), output_check_banner(), output_completion_banner(), parseCommandLine(), print_db_infos(), print_rel_infos(), print_slot_infos(), process_data_type_check(), report_clusters_compatible(), report_extension_updates(), report_unmatched_relation(), SlruReadSwitchPageSlow(), start_postmaster(), and transfer_relfile().
Referenced by adjust_data_dir(), check_cluster_versions(), 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_new_tablespace_dir(), 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_loadable_libraries(), check_new_cluster_replication_slots(), check_new_cluster_subscription_configuration(), check_old_cluster_for_valid_slots(), check_old_cluster_subscription_state(), copy_subdir_files(), copy_xact_xlog_xid(), create_conflict_detection_slot(), create_script_for_old_cluster_deletion(), disable_old_cluster(), generate_old_dump(), main(), old_9_6_invalidate_hash_indexes(), prepare_new_cluster(), prepare_new_globals(), remove_new_subdir(), report_extension_updates(), set_frozenxids(), set_locale_and_encoding(), and set_new_cluster_char_signedness().
Definition at line 13060 of file ruleutils.c.
Definition at line 281 of file parallel.c.
References fb(), UserOpts::jobs, parallel_jobs, pg_fatal, and user_opts.
Referenced by create_new_objects(), generate_old_dump(), parallel_exec_prog(), parallel_transfer_all_new_dbs(), and transfer_all_new_tablespaces().
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().
| void report_extension_updates | ( | ClusterInfo * | cluster | ) |
Definition at line 177 of file version.c.
References check_ok(), cluster(), fb(), UpgradeTaskReport::file, UpgradeTaskReport::path, pg_log(), PG_REPORT, prep_status(), process_extension_updates(), report_status(), upgrade_task_add_step(), upgrade_task_create(), upgrade_task_free(), and upgrade_task_run().
Referenced by issue_warnings_and_set_wal_level().
| MultiXactOffset rewrite_multixacts | ( | MultiXactId | from_multi, |
| MultiXactId | to_multi | ||
| ) |
Definition at line 38 of file multixact_rewrite.c.
References AllocOldMultiXactRead(), AllocSlruWrite(), ControlData::chkpnt_nxtmulti, ControlData::chkpnt_nxtmxoff, ClusterInfo::controldata, fb(), FirstMultiXactId, FreeOldMultiXactReader(), FreeSlruWrite(), GetOldMultiXactIdSingleMember(), MAXPGPATH, MultiXactIdToOffsetPage(), MXOffsetToMemberPage(), new_cluster, old_cluster, pg_sprintf(), ClusterInfo::pgdata, RecordMultiXactMembers(), RecordMultiXactOffset(), and SlruWriteSwitchPage().
Referenced by copy_xact_xlog_xid().
| void rewriteVisibilityMap | ( | const char * | fromfile, |
| const char * | tofile, | ||
| const char * | schemaName, | ||
| const char * | relName | ||
| ) |
Definition at line 216 of file file.c.
References BITS_PER_BYTE, BITS_PER_HEAPBLOCK, close, ClusterInfo::controldata, PGIOAlignedBlock::data, ControlData::data_checksum_version, fb(), fstat, i, new_cluster, PG_BINARY, pg_checksum_page(), pg_fatal, pg_file_create_mode, read, SizeOfPageHeaderData, stat::st_size, VISIBILITYMAP_ALL_VISIBLE, and write.
Referenced by transfer_relfile().
| bool start_postmaster | ( | ClusterInfo * | cluster, |
| bool | report_and_exit_on_error | ||
| ) |
Definition at line 159 of file server.c.
References appendPQExpBufferStr(), cluster(), conn, CONNECTION_OK, PQExpBufferData::data, exec_prog(), fb(), get_db_conn(), GET_MAJOR_VERSION, initPQExpBuffer(), log_opts, LogOpts::logdir, MAXPGPATH, new_cluster, old_cluster, os_info, pg_fatal, pg_log(), PG_REPORT, PQerrorMessage(), PQfinish(), PQstatus(), OSInfo::running_cluster, SERVER_LOG_FILE, SERVER_START_LOG_FILE, snprintf, stop_postmaster_atexit(), and termPQExpBuffer().
Definition at line 292 of file server.c.
References cluster(), exec_prog(), fb(), new_cluster, old_cluster, os_info, OSInfo::running_cluster, and SERVER_STOP_LOG_FILE.
Definition at line 352 of file util.c.
Referenced by get_control_data().
| void transfer_all_new_dbs | ( | DbInfoArr * | old_db_arr, |
| DbInfoArr * | new_db_arr, | ||
| char * | old_pgdata, | ||
| char * | new_pgdata, | ||
| char * | old_tablespace, | ||
| char * | new_tablespace | ||
| ) |
Definition at line 172 of file relfilenumber.c.
References fb(), gen_db_file_maps(), pg_fatal, pg_free(), sync_queue_destroy(), sync_queue_sync_all(), and transfer_single_new_db().
Referenced by parallel_transfer_all_new_dbs().
| void transfer_all_new_tablespaces | ( | DbInfoArr * | old_db_arr, |
| DbInfoArr * | new_db_arr, | ||
| char * | old_pgdata, | ||
| char * | new_pgdata | ||
| ) |
Definition at line 108 of file relfilenumber.c.
References check_ok(), end_progress_output(), fb(), UserOpts::jobs, new_cluster, ClusterInfo::num_tablespaces, old_cluster, parallel_transfer_all_new_dbs(), prep_status_progress(), reap_child(), ClusterInfo::tablespaces, 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().
| void upgrade_task_add_step | ( | UpgradeTask * | task, |
| const char * | query, | ||
| UpgradeTaskProcessCB | process_cb, | ||
| bool | free_result, | ||
| void * | arg | ||
| ) |
Definition at line 151 of file task.c.
References appendPQExpBuffer(), arg, fb(), and pg_realloc().
Referenced by 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_tables_with_oids(), check_for_unicode_update(), check_for_user_defined_encoding_conversions(), check_for_user_defined_postfix_ops(), check_old_cluster_subscription_state(), get_db_rel_and_slot_infos(), get_loadable_libraries(), report_extension_updates(), and upgrade_task_create().
| UpgradeTask * upgrade_task_create | ( | void | ) |
Definition at line 117 of file task.c.
References ALWAYS_SECURE_SEARCH_PATH_SQL, createPQExpBuffer(), fb(), pg_malloc0(), and upgrade_task_add_step().
Referenced by 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_tables_with_oids(), check_for_unicode_update(), check_for_user_defined_encoding_conversions(), check_for_user_defined_postfix_ops(), check_old_cluster_subscription_state(), get_db_rel_and_slot_infos(), get_loadable_libraries(), and report_extension_updates().
| void upgrade_task_free | ( | UpgradeTask * | task | ) |
Definition at line 133 of file task.c.
References destroyPQExpBuffer(), fb(), and pg_free().
Referenced by 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_tables_with_oids(), check_for_unicode_update(), check_for_user_defined_encoding_conversions(), check_for_user_defined_postfix_ops(), check_old_cluster_subscription_state(), get_db_rel_and_slot_infos(), get_loadable_libraries(), and report_extension_updates().
| void upgrade_task_run | ( | const UpgradeTask * | task, |
| const ClusterInfo * | cluster | ||
| ) |
Definition at line 419 of file task.c.
References cluster(), dbs_complete, dbs_processing, fb(), i, UserOpts::jobs, Max, pg_free(), pg_malloc0(), process_slot(), user_opts, and wait_on_slots().
Referenced by 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_tables_with_oids(), check_for_unicode_update(), check_for_user_defined_encoding_conversions(), check_for_user_defined_postfix_ops(), check_old_cluster_subscription_state(), get_db_rel_and_slot_infos(), get_loadable_libraries(), and report_extension_updates().
Definition at line 264 of file exec.c.
References check_bin_dir(), check_data_dir(), fb(), new_cluster, old_cluster, and pg_fatal.
Referenced by setup().
|
extern |
Definition at line 17 of file util.c.
Referenced by check_for_connection_status(), 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_tables_with_oids(), check_for_unicode_update(), check_for_user_defined_encoding_conversions(), check_for_user_defined_postfix_ops(), check_loadable_libraries(), check_old_cluster_for_valid_slots(), check_old_cluster_subscription_state(), cleanup_output_dirs(), create_new_objects(), end_progress_output(), exec_prog(), generate_old_dump(), get_db_rel_and_slot_infos(), make_outputdirs(), parseCommandLine(), pg_log_v(), prep_status_progress(), prepare_new_cluster(), prepare_new_globals(), process_data_type_check(), and start_postmaster().
| ClusterInfo new_cluster |
Definition at line 383 of file pg_upgrade.h.
|
extern |
Definition at line 73 of file pg_upgrade.c.
Referenced by adjust_data_dir(), check_and_dump_old_cluster(), check_cluster_compatibility(), check_cluster_versions(), check_copy_file_range(), check_file_clone(), check_for_isn_and_int8_passing_mismatch(), check_for_prepared_transactions(), check_hard_link(), check_loadable_libraries(), check_new_cluster(), check_new_cluster_replication_slots(), check_new_cluster_subscription_configuration(), check_old_cluster_for_valid_slots(), check_old_cluster_subscription_state(), copy_subdir_files(), copy_xact_xlog_xid(), count_old_cluster_logical_slots(), create_logical_replication_slots(), create_new_objects(), create_rel_filename_map(), create_script_for_old_cluster_deletion(), disable_old_cluster(), do_swap(), generate_old_dump(), get_control_data(), get_db_rel_and_slot_infos(), get_loadable_libraries(), get_rel_infos_query(), get_sock_dir(), get_tablespace_paths(), init_tablespaces(), issue_warnings_and_set_wal_level(), main(), parseCommandLine(), prepare_for_swap(), process_loadable_libraries(), rewrite_multixacts(), set_frozenxids(), set_locale_and_encoding(), set_new_cluster_char_signedness(), setup(), start_postmaster(), stop_postmaster(), transfer_all_new_tablespaces(), transfer_single_new_db(), usage(), and verify_directories().
|
extern |
Definition at line 75 of file pg_upgrade.c.
Referenced by check_is_install_user(), check_loadable_libraries(), cluster_conn_opts(), get_db_conn(), get_loadable_libraries(), output_completion_banner(), parseCommandLine(), process_rel_infos(), start_conn(), start_postmaster(), stop_postmaster(), and usage().
|
extern |
Definition at line 77 of file pg_upgrade.c.
Referenced by make_outputdirs().
|
extern |
Definition at line 30 of file option.c.
Referenced by check_and_dump_old_cluster(), check_cluster_compatibility(), check_cluster_versions(), check_new_cluster(), check_old_cluster_for_valid_slots(), create_new_objects(), generate_old_dump(), get_control_data(), get_old_cluster_logical_slot_infos_query(), get_rel_infos_query(), get_sock_dir(), main(), output_check_banner(), parallel_exec_prog(), parallel_transfer_all_new_dbs(), parseCommandLine(), reap_child(), report_clusters_compatible(), set_new_cluster_char_signedness(), setup(), swap_catalog_files(), transfer_all_new_tablespaces(), transfer_relfile(), transfer_single_new_db(), and upgrade_task_run().