PostgreSQL Source Code
git master
|
#include "postgres_fe.h"
#include "common/connect.h"
#include "fe_utils/string_utils.h"
#include "pg_upgrade.h"
Go to the source code of this file.
Data Structures | |
struct | UpgradeTaskStep |
struct | UpgradeTask |
struct | UpgradeTaskSlot |
Typedefs | |
typedef struct UpgradeTaskStep | UpgradeTaskStep |
typedef enum UpgradeTaskSlotState | UpgradeTaskSlotState |
typedef struct UpgradeTaskSlot | UpgradeTaskSlot |
Enumerations | |
enum | UpgradeTaskSlotState { FREE , CONNECTING , RUNNING_QUERIES } |
Functions | |
UpgradeTask * | upgrade_task_create (void) |
void | upgrade_task_free (UpgradeTask *task) |
void | upgrade_task_add_step (UpgradeTask *task, const char *query, UpgradeTaskProcessCB process_cb, bool free_result, void *arg) |
static void | start_conn (const ClusterInfo *cluster, UpgradeTaskSlot *slot) |
static void | process_query_result (const ClusterInfo *cluster, UpgradeTaskSlot *slot, const UpgradeTask *task) |
static void | process_slot (const ClusterInfo *cluster, UpgradeTaskSlot *slot, const UpgradeTask *task) |
static int | select_loop (int maxFd, fd_set *input, fd_set *output) |
static void | wait_on_slots (UpgradeTaskSlot *slots, int numslots) |
void | upgrade_task_run (const UpgradeTask *task, const ClusterInfo *cluster) |
Variables | |
static int | dbs_complete |
static int | dbs_processing |
typedef struct UpgradeTaskSlot UpgradeTaskSlot |
typedef enum UpgradeTaskSlotState UpgradeTaskSlotState |
typedef struct UpgradeTaskStep UpgradeTaskStep |
enum UpgradeTaskSlotState |
|
static |
Definition at line 206 of file task.c.
References UpgradeTaskStep::arg, cluster(), UpgradeTaskSlot::conn, CONNECTION_BAD, UpgradeTaskSlot::db_idx, dbinfo, UpgradeTaskStep::free_result, pg_fatal, PGRES_COMMAND_OK, PGRES_TUPLES_OK, PQclear(), PQerrorMessage(), PQgetResult(), PQresultStatus(), PQstatus(), UpgradeTaskStep::process_cb, res, UpgradeTaskSlot::step_idx, and UpgradeTask::steps.
Referenced by process_slot().
|
static |
Definition at line 235 of file task.c.
References cluster(), UpgradeTaskSlot::conn, CONNECTING, PQExpBufferData::data, UpgradeTaskSlot::db_idx, dbs_complete, dbs_processing, FREE, UpgradeTask::num_steps, pg_fatal, PGRES_POLLING_FAILED, PGRES_POLLING_OK, PGRES_POLLING_READING, PQconnectPoll(), PQconsumeInput(), PQerrorMessage(), PQfinish(), PQisBusy(), PQsendQuery(), process_query_result(), UpgradeTask::queries, UpgradeTaskSlot::ready, RUNNING_QUERIES, UpgradeTaskSlot::select_mode, start_conn(), UpgradeTaskSlot::state, and UpgradeTaskSlot::step_idx.
Referenced by upgrade_task_run().
|
static |
|
static |
Definition at line 174 of file task.c.
References appendConnStrVal(), appendPQExpBuffer(), appendPQExpBufferStr(), cluster(), UpgradeTaskSlot::conn, PQExpBufferData::data, UpgradeTaskSlot::db_idx, dbinfo, initPQExpBuffer(), os_info, pg_fatal, PQconnectStart(), termPQExpBuffer(), and OSInfo::user.
Referenced by process_slot().
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, UpgradeTaskStep::arg, UpgradeTaskStep::free_result, UpgradeTask::num_steps, pg_realloc(), UpgradeTaskStep::process_cb, UpgradeTask::queries, and UpgradeTask::steps.
Referenced by check_for_data_types_usage(), check_for_incompatible_polymorphics(), check_for_isn_and_int8_passing_mismatch(), check_for_tables_with_oids(), 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(), pg_malloc0(), UpgradeTask::queries, and upgrade_task_add_step().
Referenced by check_for_data_types_usage(), check_for_incompatible_polymorphics(), check_for_isn_and_int8_passing_mismatch(), check_for_tables_with_oids(), 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(), pg_free(), UpgradeTask::queries, and UpgradeTask::steps.
Referenced by check_for_data_types_usage(), check_for_incompatible_polymorphics(), check_for_isn_and_int8_passing_mismatch(), check_for_tables_with_oids(), 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 420 of file task.c.
References cluster(), dbs_complete, dbs_processing, 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_incompatible_polymorphics(), check_for_isn_and_int8_passing_mismatch(), check_for_tables_with_oids(), 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().
|
static |
Definition at line 364 of file task.c.
References conn, FREE, i, input, Max, output, pg_fatal, PQsocket(), UpgradeTaskSlot::ready, select_loop(), and UpgradeTaskSlot::sock.
Referenced by upgrade_task_run().
|
static |
Definition at line 56 of file task.c.
Referenced by process_slot(), and upgrade_task_run().
|
static |
Definition at line 63 of file task.c.
Referenced by process_slot(), and upgrade_task_run().