PostgreSQL Source Code
git master
|
#include "postgres_fe.h"
#include <time.h>
#include "catalog/pg_class_d.h"
#include "common/file_perm.h"
#include "common/logging.h"
#include "common/restricted_token.h"
#include "fe_utils/string_utils.h"
#include "pg_upgrade.h"
Go to the source code of this file.
Functions | |
static void | set_locale_and_encoding (void) |
static void | prepare_new_cluster (void) |
static void | prepare_new_globals (void) |
static void | create_new_objects (void) |
static void | copy_xact_xlog_xid (void) |
static void | set_frozenxids (bool minmxid_only) |
static void | make_outputdirs (char *pgdata) |
static void | setup (char *argv0, bool *live_check) |
int | main (int argc, char **argv) |
static void | remove_new_subdir (const char *subdir, bool rmtopdir) |
static void | copy_subdir_files (const char *old_subdir, const char *new_subdir) |
Variables | |
ClusterInfo | old_cluster |
ClusterInfo | new_cluster |
OSInfo | os_info |
char * | output_files [] |
|
static |
Definition at line 620 of file pg_upgrade.c.
References check_ok(), exec_prog(), MAXPGPATH, new_cluster, old_cluster, ClusterInfo::pgdata, prep_status(), remove_new_subdir(), snprintf, and UTILITY_LOG_FILE.
Referenced by copy_xact_xlog_xid().
|
static |
Definition at line 645 of file pg_upgrade.c.
References ClusterInfo::bindir, ControlData::cat_ver, check_ok(), ControlData::chkpnt_nxtepoch, ControlData::chkpnt_nxtmulti, ControlData::chkpnt_nxtmxoff, ControlData::chkpnt_nxtxid, ControlData::chkpnt_oldstMulti, ControlData::chkpnt_oldstxid, ClusterInfo::controldata, copy_subdir_files(), exec_prog(), GET_MAJOR_VERSION, ClusterInfo::major_version, MULTIXACT_FORMATCHANGE_CAT_VER, new_cluster, ControlData::nextxlogfile, old_cluster, ClusterInfo::pgdata, prep_status(), remove_new_subdir(), and UTILITY_LOG_FILE.
Referenced by main().
|
static |
Definition at line 497 of file pg_upgrade.c.
References ClusterInfo::bindir, check_ok(), cluster_conn_opts(), DB_DUMP_FILE_MASK, DB_DUMP_LOG_FILE_MASK, DbInfo::db_name, DbInfo::db_oid, ClusterInfo::dbarr, DbInfoArr::dbs, LogOpts::dumpdir, end_progress_output(), exec_prog(), get_db_and_rel_infos(), GET_MAJOR_VERSION, log_opts, ClusterInfo::major_version, MAXPGPATH, DbInfoArr::ndbs, new_cluster, old_cluster, parallel_exec_prog(), pg_log(), PG_STATUS, prep_status_progress(), reap_child(), set_frozenxids(), and snprintf.
Referenced by main().
int main | ( | int | argc, |
char ** | argv | ||
) |
Definition at line 80 of file pg_upgrade.c.
References adjust_data_dir(), ClusterInfo::bindir, check_and_dump_old_cluster(), check_cluster_compatibility(), check_cluster_versions(), check_new_cluster(), check_ok(), ControlData::chkpnt_nxtoid, cleanup_output_dirs(), ClusterInfo::controldata, copy_xact_xlog_xid(), create_new_objects(), create_script_for_old_cluster_deletion(), ClusterInfo::dbarr, disable_old_cluster(), UserOpts::do_sync, exec_prog(), get_restricted_token(), get_sock_dir(), GetDataDirectoryCreatePerm(), issue_warnings_and_set_wal_level(), make_outputdirs(), new_cluster, old_cluster, output_check_banner(), output_completion_banner(), parseCommandLine(), pg_fatal, pg_free(), pg_log(), pg_logging_init(), pg_mode_mask, PG_MODE_MASK_OWNER, PG_REPORT, PG_TEXTDOMAIN, ClusterInfo::pgdata, prep_status(), prepare_new_cluster(), prepare_new_globals(), report_clusters_compatible(), set_locale_and_encoding(), set_pglocale_pgservice(), setup(), start_postmaster(), stop_postmaster(), strerror, UserOpts::sync_method, transfer_all_new_tablespaces(), UserOpts::transfer_mode, TRANSFER_MODE_LINK, user_opts, and UTILITY_LOG_FILE.
|
static |
Definition at line 226 of file pg_upgrade.c.
References BASE_OUTPUTDIR, LogOpts::basedir, DUMP_OUTPUTDIR, LogOpts::dumpdir, filename, fopen_priv, fprintf, gettimeofday(), LogOpts::internal, INTERNAL_LOG_FILE, len, log_opts, LOG_OUTPUTDIR, LogOpts::logdir, MAXPGPATH, mkdir, output_files, pg_dir_create_mode, pg_fatal, pg_malloc0(), LogOpts::rootdir, and snprintf.
Referenced by main().
|
static |
Definition at line 445 of file pg_upgrade.c.
References ClusterInfo::bindir, check_ok(), cluster_conn_opts(), exec_prog(), log_opts, new_cluster, prep_status(), UTILITY_LOG_FILE, and LogOpts::verbose.
Referenced by main().
|
static |
Definition at line 475 of file pg_upgrade.c.
References ClusterInfo::bindir, check_ok(), cluster_conn_opts(), LogOpts::dumpdir, exec_prog(), EXEC_PSQL_ARGS, GLOBALS_DUMP_FILE, log_opts, new_cluster, prep_status(), set_frozenxids(), and UTILITY_LOG_FILE.
Referenced by main().
|
static |
Definition at line 603 of file pg_upgrade.c.
References check_ok(), MAXPGPATH, new_cluster, pg_fatal, ClusterInfo::pgdata, prep_status(), rmtree(), and snprintf.
Referenced by copy_subdir_files(), and copy_xact_xlog_xid().
|
static |
Definition at line 770 of file pg_upgrade.c.
References check_ok(), ControlData::chkpnt_nxtmulti, ControlData::chkpnt_nxtxid, conn, connectToServer(), ClusterInfo::controldata, CppAsString2, datallowconn, datname, executeQueryOrDie(), new_cluster, old_cluster, PQclear(), PQfinish(), PQfnumber(), PQgetvalue(), PQntuples(), prep_status(), and quote_identifier().
Referenced by create_new_objects(), and prepare_new_globals().
|
static |
Definition at line 382 of file pg_upgrade.c.
References check_ok(), connectToServer(), executeQueryOrDie(), GET_MAJOR_VERSION, locale, ClusterInfo::major_version, new_cluster, old_cluster, pg_strdup(), PQclear(), PQescapeLiteral(), PQfinish(), PQfreemem(), prep_status(), and ClusterInfo::template0.
Referenced by main().
|
static |
Definition at line 311 of file pg_upgrade.c.
References argv0, ClusterInfo::bindir, canonicalize_path(), UserOpts::check, check_pghost_envvar(), exec_path, find_my_exec(), last_dir_separator(), MAXPGPATH, new_cluster, old_cluster, pg_fatal, pg_strdup(), ClusterInfo::pgdata, pid_lock_file_exists(), start_postmaster(), stop_postmaster(), user_opts, and verify_directories().
Referenced by main().
ClusterInfo new_cluster |
Definition at line 64 of file pg_upgrade.c.
Referenced by check_bin_dir(), check_cluster_compatibility(), check_cluster_versions(), check_file_clone(), check_for_isn_and_int8_passing_mismatch(), check_for_new_tablespace_dir(), check_hard_link(), check_is_install_user(), check_loadable_libraries(), check_new_cluster(), check_new_cluster_is_empty(), copy_subdir_files(), copy_xact_xlog_xid(), create_new_objects(), create_rel_filename_map(), create_script_for_old_cluster_deletion(), generate_old_dump(), get_control_data(), init_tablespaces(), issue_warnings_and_set_wal_level(), main(), output_completion_banner(), parseCommandLine(), prepare_new_cluster(), prepare_new_globals(), remove_new_subdir(), rewriteVisibilityMap(), set_frozenxids(), set_locale_and_encoding(), setup(), start_postmaster(), stop_postmaster(), transfer_single_new_db(), usage(), and verify_directories().
ClusterInfo old_cluster |
Definition at line 63 of file pg_upgrade.c.
Referenced by adjust_data_dir(), check_and_dump_old_cluster(), check_cluster_compatibility(), check_cluster_versions(), check_file_clone(), check_for_isn_and_int8_passing_mismatch(), check_for_prepared_transactions(), check_hard_link(), check_loadable_libraries(), copy_subdir_files(), copy_xact_xlog_xid(), create_new_objects(), create_rel_filename_map(), create_script_for_old_cluster_deletion(), disable_old_cluster(), generate_old_dump(), get_control_data(), get_db_and_rel_infos(), get_loadable_libraries(), get_sock_dir(), get_tablespace_paths(), init_tablespaces(), issue_warnings_and_set_wal_level(), main(), parseCommandLine(), set_frozenxids(), set_locale_and_encoding(), setup(), start_postmaster(), stop_postmaster(), transfer_single_new_db(), usage(), and verify_directories().
OSInfo os_info |
Definition at line 65 of file pg_upgrade.c.
Referenced by check_for_new_tablespace_dir(), check_is_install_user(), check_loadable_libraries(), cluster_conn_opts(), create_script_for_old_cluster_deletion(), get_db_conn(), get_loadable_libraries(), get_tablespace_paths(), init_tablespaces(), output_completion_banner(), parseCommandLine(), start_postmaster(), stop_postmaster(), transfer_all_new_tablespaces(), and usage().
char* output_files[] |
Definition at line 67 of file pg_upgrade.c.
Referenced by make_outputdirs().