PostgreSQL Source Code git master
|
#include "postgres_fe.h"
#include "common/connect.h"
#include "fe_utils/string_utils.h"
#include "libpq/pqcomm.h"
#include "pg_upgrade.h"
Go to the source code of this file.
Functions | |
static PGconn * | get_db_conn (ClusterInfo *cluster, const char *db_name) |
PGconn * | connectToServer (ClusterInfo *cluster, const char *db_name) |
char * | cluster_conn_opts (ClusterInfo *cluster) |
PGresult * | executeQueryOrDie (PGconn *conn, const char *fmt,...) |
uint32 | get_major_server_version (ClusterInfo *cluster) |
static void | stop_postmaster_atexit (void) |
bool | start_postmaster (ClusterInfo *cluster, bool report_and_exit_on_error) |
void | stop_postmaster (bool in_atexit) |
void | check_pghost_envvar (void) |
void check_pghost_envvar | ( | void | ) |
Definition at line 369 of file server.c.
References is_unixsock_path(), pg_fatal, PQconndefaults(), PQconninfoFree(), start, and value.
Referenced by setup().
char * cluster_conn_opts | ( | ClusterInfo * | cluster | ) |
Definition at line 92 of file server.c.
References appendPQExpBuffer(), appendPQExpBufferChar(), appendPQExpBufferStr(), appendShellString(), buf, cluster(), createPQExpBuffer(), 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(), exit(), 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_logical_replication_slots(), check_new_cluster_subscription_configuration(), check_old_cluster_subscription_state(), create_logical_replication_slots(), create_new_objects(), get_db_infos(), get_subscription_count(), get_tablespace_paths(), get_template0_info(), old_9_6_invalidate_hash_indexes(), set_frozenxids(), and set_locale_and_encoding().
Definition at line 122 of file server.c.
References _, generate_unaccent_rules::args, conn, exit(), fmt, pg_log(), PG_REPORT, PG_VERBOSE, PGRES_COMMAND_OK, PGRES_TUPLES_OK, PQclear(), PQerrorMessage(), PQexec(), PQfinish(), PQresultStatus(), printf, QUERY_ALLOC, va_end(), va_start(), and vsnprintf.
Referenced by connectToServer().
|
static |
Definition at line 57 of file server.c.
References appendConnStrVal(), appendPQExpBuffer(), appendPQExpBufferStr(), cluster(), conn, PQExpBufferData::data, initPQExpBuffer(), os_info, PQconnectdb(), termPQExpBuffer(), and OSInfo::user.
Referenced by connectToServer(), and start_postmaster().
uint32 get_major_server_version | ( | ClusterInfo * | cluster | ) |
Definition at line 159 of file server.c.
References cluster(), MAXPGPATH, pg_fatal, and snprintf.
Referenced by check_data_dir().
bool start_postmaster | ( | ClusterInfo * | cluster, |
bool | report_and_exit_on_error | ||
) |
Definition at line 198 of file server.c.
References appendPQExpBufferStr(), cluster(), conn, CONNECTION_OK, PQExpBufferData::data, exec_prog(), 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().
void stop_postmaster | ( | bool | in_atexit | ) |
Definition at line 342 of file server.c.
References cluster(), exec_prog(), new_cluster, old_cluster, os_info, OSInfo::running_cluster, and SERVER_STOP_LOG_FILE.
Referenced by check_and_dump_old_cluster(), issue_warnings_and_set_wal_level(), main(), report_clusters_compatible(), setup(), and stop_postmaster_atexit().
|
static |
Definition at line 191 of file server.c.
References stop_postmaster().
Referenced by start_postmaster().