PostgreSQL Source Code git master
|
#include "postgres_fe.h"
#include <sys/stat.h>
#include <fcntl.h>
#include <ctype.h>
#include <netdb.h>
#include <time.h>
#include <unistd.h>
#include "common/base64.h"
#include "common/ip.h"
#include "common/link-canary.h"
#include "common/scram-common.h"
#include "common/string.h"
#include "fe-auth.h"
#include "fe-auth-oauth.h"
#include "libpq-fe.h"
#include "libpq-int.h"
#include "mb/pg_wchar.h"
#include "pg_config_paths.h"
#include "port/pg_bswap.h"
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <pwd.h>
#include <pthread.h>
Go to the source code of this file.
Data Structures | |
struct | _internalPQconninfoOption |
Macros | |
#define | PGPASSFILE ".pgpass" |
#define | ERRCODE_APPNAME_UNKNOWN "42704" |
#define | ERRCODE_INVALID_PASSWORD "28P01" |
#define | ERRCODE_CANNOT_CONNECT_NOW "57P03" |
#define | DefaultHost "localhost" |
#define | DefaultOption "" |
#define | DefaultChannelBinding "disable" |
#define | DefaultTargetSessionAttrs "any" |
#define | DefaultLoadBalanceHosts "disable" |
#define | DefaultSSLMode "disable" |
#define | DefaultSSLCertMode "disable" |
#define | DefaultSSLNegotiation "postgres" |
#define | DefaultGSSMode "disable" |
#define | SASL_MECHANISM_COUNT lengthof(supported_sasl_mechs) |
#define | ENCRYPTION_NEGOTIATION_FAILED(msg) |
#define | CONNECTION_FAILED() |
#define | MAX_ERRLEN 30000 |
#define | SELECT_NEXT_METHOD(method) |
Typedefs | |
typedef struct _internalPQconninfoOption | internalPQconninfoOption |
Variables | |
static const internalPQconninfoOption | PQconninfoOptions [] |
static const PQEnvironmentOption | EnvironmentOptions [] |
static const pg_fe_sasl_mech * | supported_sasl_mechs [] |
static const char | uri_designator [] = "postgresql://" |
static const char | short_uri_designator [] = "postgres://" |
pgthreadlock_t | pg_g_threadlock = default_threadlock |
#define CONNECTION_FAILED | ( | ) |
#define DefaultChannelBinding "disable" |
Definition at line 124 of file fe-connect.c.
#define DefaultGSSMode "disable" |
Definition at line 140 of file fe-connect.c.
#define DefaultHost "localhost" |
Definition at line 119 of file fe-connect.c.
#define DefaultLoadBalanceHosts "disable" |
Definition at line 127 of file fe-connect.c.
#define DefaultOption "" |
Definition at line 120 of file fe-connect.c.
#define DefaultSSLCertMode "disable" |
Definition at line 133 of file fe-connect.c.
#define DefaultSSLMode "disable" |
Definition at line 132 of file fe-connect.c.
#define DefaultSSLNegotiation "postgres" |
Definition at line 135 of file fe-connect.c.
#define DefaultTargetSessionAttrs "any" |
Definition at line 126 of file fe-connect.c.
#define ENCRYPTION_NEGOTIATION_FAILED | ( | msg | ) |
#define ERRCODE_APPNAME_UNKNOWN "42704" |
Definition at line 89 of file fe-connect.c.
#define ERRCODE_CANNOT_CONNECT_NOW "57P03" |
Definition at line 94 of file fe-connect.c.
#define ERRCODE_INVALID_PASSWORD "28P01" |
Definition at line 92 of file fe-connect.c.
#define MAX_ERRLEN 30000 |
#define PGPASSFILE ".pgpass" |
Definition at line 78 of file fe-connect.c.
#define SASL_MECHANISM_COUNT lengthof(supported_sasl_mechs) |
Definition at line 436 of file fe-connect.c.
#define SELECT_NEXT_METHOD | ( | method | ) |
typedef struct _internalPQconninfoOption internalPQconninfoOption |
|
inlinestatic |
Definition at line 1209 of file fe-connect.c.
References pg_conn::allowed_sasl_mechs, conn, i, and lengthof.
Referenced by pqConnectOptions2().
|
static |
Definition at line 2458 of file fe-connect.c.
References SockAddr::addr, appendPQExpBuffer(), conn, pg_conn::errorMessage, libpq_append_conn_error(), PG_STRERROR_R_BUFLEN, pg_conn::raddr, and SOCK_STRERROR.
Referenced by PQconnectPoll().
|
static |
Definition at line 4783 of file fe-connect.c.
References Assert(), conn, pg_conn::current_enc_method, pg_conn::failed_enc_methods, and select_next_encryption_method().
|
static |
Definition at line 2343 of file fe-connect.c.
References conn, libpq_append_conn_error(), PG_STRERROR_R_BUFLEN, pg_conn::sock, SOCK_ERRNO, and SOCK_STRERROR.
Referenced by PQconnectPoll().
|
static |
Definition at line 1066 of file fe-connect.c.
References conn, CONNECTION_BAD, pg_conn::errorMessage, fillPGconn(), parse_connection_string(), PQconninfoFree(), and pg_conn::status.
Referenced by PQconnectStart(), and PQsetdbLogin().
|
static |
Definition at line 6599 of file fe-connect.c.
References free, libpq_append_error(), parseServiceInfo(), pg_fe_getauthname(), option::val, and _PQconninfoOption::val.
Referenced by conninfo_array_parse(), conninfo_parse(), conninfo_uri_parse(), and PQconndefaults().
|
static |
Definition at line 6441 of file fe-connect.c.
References conninfo_add_defaults(), conninfo_init(), free, i, _PQconninfoOption::keyword, keywords, libpq_append_error(), options, parse_connection_string(), PQconninfoFree(), recognized_connection_string(), option::val, val, _PQconninfoOption::val, and values.
Referenced by PQconnectStartParams().
|
static |
Definition at line 7372 of file fe-connect.c.
Referenced by conninfo_getval(), and conninfo_storeval().
|
static |
Definition at line 7282 of file fe-connect.c.
References conninfo_find(), and option::val.
Referenced by fillPGconn(), and parseServiceInfo().
|
static |
Definition at line 6172 of file fe-connect.c.
References _internalPQconninfoOption::keyword, libpq_append_error(), malloc, MemSet, options, and PQconninfoOptions.
Referenced by conninfo_array_parse(), conninfo_parse(), conninfo_uri_parse(), PQconndefaults(), and PQconninfo().
|
static |
Definition at line 6265 of file fe-connect.c.
References buf, conninfo_add_defaults(), conninfo_init(), conninfo_storeval(), free, libpq_append_error(), options, and PQconninfoFree().
Referenced by parse_connection_string().
|
static |
Definition at line 7308 of file fe-connect.c.
References conninfo_find(), conninfo_uri_decode(), free, libpq_append_error(), option::val, and value.
Referenced by conninfo_parse(), conninfo_uri_parse_options(), conninfo_uri_parse_params(), and PQconninfo().
|
static |
Definition at line 7161 of file fe-connect.c.
References buf, free, get_hexdigit(), libpq_append_error(), malloc, and str.
Referenced by conninfo_storeval(), and conninfo_uri_parse_params().
|
static |
Definition at line 6734 of file fe-connect.c.
References conninfo_add_defaults(), conninfo_init(), conninfo_uri_parse_options(), options, and PQconninfoFree().
Referenced by parse_connection_string().
|
static |
Definition at line 6787 of file fe-connect.c.
References appendPQExpBufferChar(), appendPQExpBufferStr(), buf, cleanup(), conninfo_storeval(), conninfo_uri_parse_params(), PQExpBufferData::data, dbname, free, initPQExpBuffer(), libpq_append_error(), password, port, PQExpBufferDataBroken, start, termPQExpBuffer(), uri_prefix_length(), and user.
Referenced by conninfo_uri_parse().
|
static |
Definition at line 7028 of file fe-connect.c.
References conninfo_storeval(), conninfo_uri_decode(), free, PQExpBufferData::len, libpq_append_error(), and value.
Referenced by conninfo_uri_parse_options().
|
static |
Definition at line 1103 of file fe-connect.c.
References input.
Referenced by pqConnectOptions2().
|
static |
Definition at line 8260 of file fe-connect.c.
References Assert(), PTHREAD_MUTEX_INITIALIZER, pthread_mutex_lock(), and pthread_mutex_unlock().
Referenced by PQregisterThreadLock().
|
static |
Definition at line 7838 of file fe-connect.c.
Referenced by pqMakeEmptyPGconn().
|
static |
Definition at line 7823 of file fe-connect.c.
References arg, pg_result::noticeHooks, PGNoticeHooks::noticeProc, PGNoticeHooks::noticeProcArg, and PQresultErrorMessage().
Referenced by pqMakeEmptyPGconn().
|
static |
Definition at line 2402 of file fe-connect.c.
References SockAddr::addr, appendPQExpBuffer(), CHT_HOST_ADDRESS, conn, pg_conn::connhost, pg_conn::errorMessage, pg_conn_host::host, pg_conn_host::hostaddr, libpq_gettext, pg_getnameinfo_all(), pg_conn_host::port, pg_conn::raddr, SockAddr::salen, pg_conn_host::type, and pg_conn::whichhost.
Referenced by PQconnectPoll().
|
inlinestatic |
Definition at line 1185 of file fe-connect.c.
References pg_conn::allowed_sasl_mechs, conn, i, lengthof, SASL_MECHANISM_COUNT, StaticAssertDecl, and supported_sasl_mechs.
Referenced by pqConnectOptions2().
|
static |
Definition at line 987 of file fe-connect.c.
References conn, conninfo_getval(), free, libpq_append_conn_error(), and PQconninfoOptions.
Referenced by connectOptions1(), and PQconnectStartParams().
|
static |
Definition at line 5037 of file fe-connect.c.
References pg_conn::appname, pg_conn::channel_binding, pg_conn::client_encoding_initial, conn, PGEventConnDestroy::conn, pg_conn::connect_timeout, pg_conn::connip, pg_conn::dbName, pg_conn::errorMessage, pg_conn::events, explicit_bzero(), pg_conn::fbappname, free, pg_conn::gssdelegation, pg_conn::gssencmode, pg_conn::gsslib, i, pg_conn::inBuffer, pg_conn::keepalives, pg_conn::keepalives_count, pg_conn::keepalives_idle, pg_conn::keepalives_interval, pg_conn::krbsrvname, pg_conn::load_balance_hosts, PGEvent::name, pg_conn::nEvents, pg_conn::oauth_client_id, pg_conn::oauth_client_secret, pg_conn::oauth_discovery_uri, pg_conn::oauth_issuer, pg_conn::oauth_issuer_id, pg_conn::oauth_scope, pg_conn::outBuffer, PGEvent::passThrough, PGEVT_CONNDESTROY, pg_conn::pghost, pg_conn::pghostaddr, pg_conn::pgoptions, pg_conn::pgpass, pg_conn::pgpassfile, pg_conn::pgport, pg_conn::pgtcp_user_timeout, pg_conn::pguser, pqReleaseConnHosts(), PGEvent::proc, release_conn_addrinfo(), pg_conn::replication, pg_conn::require_auth, pg_conn::requirepeer, pg_conn::rowBuf, pg_conn::scram_client_key, pg_conn::scram_server_key, pg_conn::ssl_max_protocol_version, pg_conn::ssl_min_protocol_version, pg_conn::sslcert, pg_conn::sslcertmode, pg_conn::sslcompression, pg_conn::sslcrl, pg_conn::sslcrldir, pg_conn::sslkey, pg_conn::sslmode, pg_conn::sslnegotiation, pg_conn::sslpassword, pg_conn::sslrootcert, pg_conn::sslsni, pg_conn::target_session_attrs, termPQExpBuffer(), pg_conn::workBuffer, and pg_conn::write_err_msg.
Referenced by PQfinish(), and pqMakeEmptyPGconn().
|
static |
Definition at line 7261 of file fe-connect.c.
References value.
Referenced by conninfo_uri_decode().
|
static |
Definition at line 2369 of file fe-connect.c.
References SockAddr::addr, conn, pg_inet_net_ntop(), and pg_conn::raddr.
Referenced by PQconnectPoll().
|
inlinestatic |
Definition at line 1220 of file fe-connect.c.
References pg_conn::allowed_sasl_mechs, conn, i, and lengthof.
Referenced by pqConnectOptions2().
|
static |
Definition at line 4693 of file fe-connect.c.
References SockAddr::addr, pg_conn::allowed_enc_methods, conn, pg_conn::current_enc_method, ENC_ERROR, ENC_GSSAPI, ENC_PLAINTEXT, ENC_SSL, pg_conn::gssencmode, libpq_append_conn_error(), pg_conn::raddr, select_next_encryption_method(), and pg_conn::sslmode.
Referenced by PQconnectPoll().
Definition at line 4873 of file fe-connect.c.
References pg_conn::auth_req_received, conn, CONNECTION_BAD, ERRCODE_CANNOT_CONNECT_NOW, pg_conn::last_sqlstate, pg_conn::options_valid, pqConnectDBComplete(), PQPING_NO_ATTEMPT, PQPING_NO_RESPONSE, PQPING_OK, PQPING_REJECT, and pg_conn::status.
Referenced by PQping(), and PQpingParams().
|
static |
Definition at line 1162 of file fe-connect.c.
References conn, gettimeofday(), pg_prng_seed(), pg_prng_strong_seed, and pg_conn::prng_state.
Referenced by pqConnectOptions2().
|
static |
Definition at line 1127 of file fe-connect.c.
Referenced by pqConnectOptions2().
|
static |
Definition at line 6211 of file fe-connect.c.
References conninfo_parse(), conninfo_uri_parse(), connstr, and uri_prefix_length().
Referenced by connectOptions1(), conninfo_array_parse(), and PQconninfoParse().
|
static |
Definition at line 5972 of file fe-connect.c.
References buf, i, sort-test::key, len, libpq_append_error(), and val.
Referenced by parseServiceInfo().
|
static |
Definition at line 5904 of file fe-connect.c.
References conninfo_getval(), libpq_append_error(), MAXPGPATH, parseServiceFile(), pqGetHomeDirectory(), snprintf, stat, and strlcpy().
Referenced by conninfo_add_defaults().
|
static |
Definition at line 7887 of file fe-connect.c.
References buf, dbname, DEFAULT_PGSOCKET_DIR, DefaultHost, enlargePQExpBuffer(), explicit_bzero(), fprintf, fstat, hostname, initPQExpBuffer(), is_unixsock_path(), len, libpq_gettext, pg_strip_crlf(), port, pwdfMatchesString(), S_IRWXG, S_IRWXO, S_ISREG, stat::st_mode, termPQExpBuffer(), and username.
Referenced by pqConnectOptions2().
|
static |
Definition at line 8034 of file fe-connect.c.
References conn, pg_conn::connhost, ERRCODE_INVALID_PASSWORD, libpq_append_conn_error(), pg_conn_host::password, pg_conn::password_needed, PG_DIAG_SQLSTATE, pg_conn::pgpassfile, PQresultErrorField(), pg_conn::result, and pg_conn::whichhost.
Referenced by PQconnectPoll().
int PQbackendPID | ( | const PGconn * | conn | ) |
Definition at line 7655 of file fe-connect.c.
References pg_conn::be_pid, conn, CONNECTION_OK, and pg_conn::status.
Referenced by exec_command_conninfo(), get_prompt(), libpqrcv_get_backend_pid(), main(), postgres_fdw_get_connections_internal(), send_cancellable_query_impl(), and StartLogStreamer().
int PQclientEncoding | ( | const PGconn * | conn | ) |
Definition at line 7709 of file fe-connect.c.
References pg_conn::client_encoding, conn, CONNECTION_OK, and pg_conn::status.
Referenced by appendQualifiedRelation(), appendStringLiteralConn(), dblink_connect(), dblink_get_conn(), escape_append_literal(), escape_fmt_id(), exec_command_encoding(), gen_reindex_command(), get_parallel_tabidx_list(), get_parallel_tables_list(), main(), processSQLNamePattern(), retrieve_objects(), SendQuery(), setup_connection(), SyncVariables(), test_one_vector_escape(), and test_psql_parse().
void pqClosePGconn | ( | PGconn * | conn | ) |
Definition at line 5243 of file fe-connect.c.
References pg_conn::asyncStatus, pg_conn::cancelRequest, conn, CONNECTION_BAD, pg_conn::nonblocking, PGASYNC_IDLE, pg_conn::pipelineStatus, PQ_PIPELINE_OFF, pqClearAsyncResult(), pqClearConnErrorState, pqClearOAuthToken(), pqDropConnection(), pqDropServerData(), PQTRANS_IDLE, release_conn_addrinfo(), sendTerminateConn(), pg_conn::status, and pg_conn::xactStatus.
Referenced by PQcancelReset(), PQfinish(), PQreset(), and PQresetStart().
PQconninfoOption * PQconndefaults | ( | void | ) |
Definition at line 2190 of file fe-connect.c.
References conninfo_add_defaults(), conninfo_init(), initPQExpBuffer(), PQconninfoFree(), PQExpBufferDataBroken, and termPQExpBuffer().
Referenced by check_pghost_envvar(), dblink_fdw_validator(), do_connect(), get_connect_string(), GetDbnameFromConnectionOptions(), InitPgFdwOptions(), and main().
PGconn * PQconnectdb | ( | const char * | conninfo | ) |
Definition at line 813 of file fe-connect.c.
References conn, CONNECTION_BAD, pqConnectDBComplete(), PQconnectStart(), and pg_conn::status.
Referenced by connect_database(), get_db_conn(), and main().
int pqConnectDBComplete | ( | PGconn * | conn | ) |
Definition at line 2779 of file fe-connect.c.
References pg_conn::cancelRequest, conn, pg_conn::connect_timeout, CONNECTION_BAD, CONNECTION_NEEDED, end_time, flag(), PGRES_POLLING_OK, PGRES_POLLING_READING, PGRES_POLLING_WRITING, PQcancelPoll(), PQconnectPoll(), PQgetCurrentTimeUSec(), pqParseIntParam(), pqWaitTimed(), pg_conn::status, pg_conn::try_next_addr, pg_conn::whichaddr, and pg_conn::whichhost.
Referenced by internal_ping(), PQcancelBlocking(), PQconnectdb(), PQconnectdbParams(), PQreset(), and PQsetdbLogin().
PGconn * PQconnectdbParams | ( | const char *const * | keywords, |
const char *const * | values, | ||
int | expand_dbname | ||
) |
Definition at line 758 of file fe-connect.c.
References conn, CONNECTION_BAD, keywords, pqConnectDBComplete(), PQconnectStartParams(), pg_conn::status, and values.
Referenced by ConnectDatabase(), connectDatabase(), copy_connection(), doConnect(), ECPGconnect(), GetConnection(), main(), sql_conn(), test_protocol_version(), and vacuumlo().
int pqConnectDBStart | ( | PGconn * | conn | ) |
Definition at line 2701 of file fe-connect.c.
References appendPQExpBufferStr(), pg_conn::cancelRequest, conn, CONNECTION_BAD, CONNECTION_NEEDED, pg_conn::errorMessage, pg_conn::inCursor, pg_conn::inEnd, pg_conn::inStart, pg_conn::options_valid, pg_conn::outCount, pg_link_canary_is_frontend(), PGRES_POLLING_WRITING, PQconnectPoll(), pqDropConnection(), SERVER_TYPE_PREFER_STANDBY, SERVER_TYPE_PREFER_STANDBY_PASS2, pg_conn::status, pg_conn::target_server_type, pg_conn::try_next_addr, pg_conn::try_next_host, and pg_conn::whichhost.
Referenced by PQcancelStart(), PQconnectStart(), PQconnectStartParams(), PQreset(), PQresetStart(), and PQsetdbLogin().
int PQconnectionNeedsPassword | ( | const PGconn * | conn | ) |
Definition at line 7672 of file fe-connect.c.
References conn, password, pg_conn::password_needed, and PQpass().
Referenced by ConnectDatabase(), connectDatabase(), do_connect(), doConnect(), GetConnection(), main(), sql_conn(), and vacuumlo().
int PQconnectionUsedGSSAPI | ( | const PGconn * | conn | ) |
Definition at line 7698 of file fe-connect.c.
References conn, and pg_conn::gssapi_used.
Referenced by dblink_security_check(), exec_command_conninfo(), and pgfdw_security_check().
int PQconnectionUsedPassword | ( | const PGconn * | conn | ) |
Definition at line 7687 of file fe-connect.c.
References conn, and pg_conn::password_needed.
Referenced by ConnectDatabaseAhx(), dblink_security_check(), exec_command_conninfo(), libpqrcv_connect(), and pgfdw_security_check().
bool pqConnectOptions2 | ( | PGconn * | conn | ) |
Definition at line 1240 of file fe-connect.c.
References pg_conn::allowed_auth_methods, pg_conn::allowed_sasl_mechs, Assert(), AUTH_REQ_GSS, AUTH_REQ_GSS_CONT, AUTH_REQ_MD5, AUTH_REQ_PASSWORD, AUTH_REQ_SASL, AUTH_REQ_SASL_CONT, AUTH_REQ_SASL_FIN, AUTH_REQ_SSPI, pg_conn::auth_required, calloc, pg_conn::channel_binding, CHT_HOST_ADDRESS, CHT_HOST_NAME, CHT_UNIX_SOCKET, clear_allowed_sasl_mechs(), pg_conn::client_encoding_initial, conn, CONNECTION_BAD, pg_conn::connhost, count_comma_separated_elems(), pg_conn::dbName, DEFAULT_PGSOCKET_DIR, DefaultChannelBinding, DefaultGSSMode, DefaultHost, DefaultSSLCertMode, DefaultSSLMode, DefaultSSLNegotiation, pg_conn::errorMessage, fill_allowed_sasl_mechs(), free, pg_conn::gssencmode, pg_conn_host::host, pg_conn_host::hostaddr, i, index_of_allowed_sasl_mech(), is_unixsock_path(), j, len, lengthof, libpq_append_conn_error(), libpq_prng_init(), LOAD_BALANCE_DISABLE, pg_conn::load_balance_hosts, LOAD_BALANCE_RANDOM, pg_conn::load_balance_type, malloc, pg_conn::max_protocol_version, pg_conn::max_pversion, MAXPGPATH, pg_conn::min_protocol_version, pg_conn::min_pversion, pg_conn::nconnhost, pg_conn::options_valid, parse_comma_separated_list(), pg_conn_host::password, passwordFromFile(), pg_b64_dec_len(), pg_b64_decode(), pg_encoding_to_char, pg_fe_getauthname(), pg_get_encoding_from_locale(), pg_oauth_mech, pg_prng_uint64_range(), PG_PROTOCOL, PG_PROTOCOL_EARLIEST, PG_PROTOCOL_LATEST, pg_scram_mech, pg_conn::pghost, pg_conn::pghostaddr, pg_conn::pgpass, PGPASSFILE, pg_conn::pgpassfile, pg_conn::pgport, pg_conn::pguser, pg_conn_host::port, pqGetHomeDirectory(), pqParseProtocolVersion(), pg_conn::prng_state, pg_conn::require_auth, pg_conn::scram_client_key, pg_conn::scram_client_key_binary, pg_conn::scram_client_key_len, SCRAM_MAX_KEY_LEN, pg_conn::scram_server_key, pg_conn::scram_server_key_binary, pg_conn::scram_server_key_len, SERVER_TYPE_ANY, SERVER_TYPE_PREFER_STANDBY, SERVER_TYPE_PRIMARY, SERVER_TYPE_READ_ONLY, SERVER_TYPE_READ_WRITE, SERVER_TYPE_STANDBY, snprintf, pg_conn::ssl_max_protocol_version, pg_conn::ssl_min_protocol_version, pg_conn::sslcertmode, pg_conn::sslmode, pg_conn::sslnegotiation, pg_conn::sslrootcert, sslVerifyProtocolRange(), sslVerifyProtocolVersion(), pg_conn::status, pg_conn::target_server_type, pg_conn::target_session_attrs, pg_conn_host::type, and pg_conn::whichhost.
Referenced by PQcancelCreate(), PQconnectStart(), PQconnectStartParams(), and PQsetdbLogin().
PostgresPollingStatusType PQconnectPoll | ( | PGconn * | conn | ) |
Definition at line 2905 of file fe-connect.c.
References SockAddr::addr, AddrInfo::addr, pg_conn::addr, pg_conn::allowed_enc_methods, pg_conn::altsock, appendPQExpBufferChar(), pg_conn::appname, Assert(), pg_conn::async_auth, pg_conn::asyncStatus, AUTH_REQ_OK, pg_conn::auth_req_received, pg_conn::cancelRequest, CHT_HOST_ADDRESS, CHT_HOST_NAME, CHT_UNIX_SOCKET, pg_conn::cleanup_async_auth, conn, connect, connectFailureMessage(), CONNECTION_AUTH_OK, CONNECTION_AUTHENTICATING, CONNECTION_AWAITING_RESPONSE, CONNECTION_BAD, CONNECTION_CHECK_STANDBY, CONNECTION_CHECK_TARGET, CONNECTION_CHECK_WRITABLE, CONNECTION_CONSUME, CONNECTION_FAILED, CONNECTION_GSS_STARTUP, CONNECTION_MADE, CONNECTION_NEEDED, CONNECTION_OK, CONNECTION_SSL_STARTUP, CONNECTION_STARTED, connectNoDelay(), pg_conn::connhost, pg_conn::connip, pg_conn::current_enc_method, PQExpBufferData::data, pg_conn::default_transaction_read_only, EINPROGRESS, EINTR, emitHostIdentityInfo(), ENC_GSSAPI, ENC_SSL, ENCRYPTION_NEGOTIATION_FAILED, EnvironmentOptions, err(), ERRCODE_APPNAME_UNKNOWN, ERRCODE_CANNOT_CONNECT_NOW, pg_conn::errorMessage, EWOULDBLOCK, pg_conn::failed_enc_methods, AddrInfo::family, pg_conn::fbappname, free, gai_strerror(), getHostaddr(), getpeereid(), pg_conn::gssencmode, pg_conn_host::host, pg_conn_host::hostaddr, i, pg_conn::in_hot_standby, pg_conn::inCursor, pg_conn::inEnd, init_allowed_encryption_methods(), pg_conn::inStart, j, pg_conn::laddr, pg_conn::last_sqlstate, PQExpBufferData::len, libpq_append_conn_error(), libpq_gettext, LOAD_BALANCE_RANDOM, pg_conn::load_balance_type, MAX_ERRLEN, pg_conn::max_pversion, MAXPGPATH, MemSet, pg_conn::naddr, pg_conn::nconnhost, NEGOTIATE_GSS_CODE, NEGOTIATE_SSL_CODE, pg_conn::oauth_want_retry, pg_conn::Pfdebug, PG_BOOL_NO, PG_BOOL_UNKNOWN, PG_BOOL_YES, PG_DIAG_SQLSTATE, pg_fe_getusername(), pg_fe_sendauth(), pg_freeaddrinfo_all(), pg_getaddrinfo_all(), pg_GSS_have_cred_cache(), pg_hton32, pg_oauth_mech, pg_prng_uint64_range(), pg_set_noblock(), PG_STRERROR_R_BUFLEN, PGASYNC_BUSY, PGASYNC_IDLE, PGINVALID_SOCKET, pgpassfileWarning(), PGRES_FATAL_ERROR, PGRES_POLLING_FAILED, PGRES_POLLING_OK, PGRES_POLLING_READING, PGRES_POLLING_WRITING, PGRES_TUPLES_OK, pg_conn::pipelineStatus, pg_conn_host::port, portstr, PQ_PIPELINE_OFF, pqBuildStartupPacket3(), pqCheckInBufferSpace(), PQclear(), pqClearAsyncResult(), pqClearConnErrorState, pqClearOAuthToken(), PQconsumeInput(), pqDropConnection(), pqDropServerData(), pqFlush(), pqGetc(), pqGetErrorNotice3(), pqGetInt(), pqGetNegotiateProtocolVersion3(), PQgetResult(), pqGets_append(), PQgetvalue(), PQisBusy(), PqMsg_AuthenticationRequest, PqMsg_ErrorResponse, PqMsg_NegotiateProtocolVersion, PQntuples(), pqPacketSend(), pqParseDone(), pqParseIntParam(), pqReadData(), PQresultErrorField(), PQresultStatus(), pqsecure_open_client(), pqsecure_open_gss(), PQsendCancelRequest(), PQsendQueryContinue(), pqTraceOutputCharResponse(), PQTRANS_IDLE, pg_conn::prng_state, pg_conn::pversion, pg_conn::pversion_negotiated, pg_conn::raddr, release_conn_addrinfo(), pg_conn::requirepeer, pg_result::resultStatus, SockAddr::salen, pg_conn::sasl, pg_conn::send_appname, sendTerminateConn(), SERVER_TYPE_PREFER_STANDBY, SERVER_TYPE_PREFER_STANDBY_PASS2, SERVER_TYPE_PRIMARY, SERVER_TYPE_READ_ONLY, SERVER_TYPE_READ_WRITE, SERVER_TYPE_STANDBY, setKeepalivesCount(), setKeepalivesIdle(), setKeepalivesInterval(), setTCPUserTimeout(), pg_conn::sigpipe_flag, pg_conn::sigpipe_so, snprintf, pg_conn::sock, SOCK_ERRNO, SOCK_STRERROR, socket, pg_conn::ssl_in_use, pg_conn::sslnegotiation, pg_conn::status, STATUS_OK, store_conn_addrinfo(), strerror_r, pg_conn::sversion, pg_conn::target_server_type, pg_conn::try_next_addr, pg_conn::try_next_host, pg_conn_host::type, UNIXSOCK_PATH, UNIXSOCK_PATH_BUFLEN, useKeepalives(), val, pg_conn::whichaddr, pg_conn::whichhost, and pg_conn::xactStatus.
Referenced by libpqsrv_connect_internal(), main(), PQcancelPoll(), pqConnectDBComplete(), pqConnectDBStart(), PQresetPoll(), process_slot(), and wait_until_connected().
PGconn * PQconnectStart | ( | const char * | conninfo | ) |
Definition at line 941 of file fe-connect.c.
References conn, CONNECTION_BAD, connectOptions1(), pqConnectDBStart(), pqConnectOptions2(), pqMakeEmptyPGconn(), and pg_conn::status.
Referenced by libpqsrv_connect(), main(), PQconnectdb(), PQping(), and start_conn().
PGconn * PQconnectStartParams | ( | const char *const * | keywords, |
const char *const * | values, | ||
int | expand_dbname | ||
) |
Definition at line 860 of file fe-connect.c.
References conn, CONNECTION_BAD, conninfo_array_parse(), pg_conn::errorMessage, fillPGconn(), keywords, pqConnectDBStart(), pqConnectOptions2(), PQconninfoFree(), pqMakeEmptyPGconn(), pg_conn::status, and values.
Referenced by do_connect(), libpqsrv_connect_params(), PQconnectdbParams(), and PQpingParams().
PQconninfoOption * PQconninfo | ( | PGconn * | conn | ) |
Definition at line 7390 of file fe-connect.c.
References conn, conninfo_init(), conninfo_storeval(), initPQExpBuffer(), PQconninfoOptions, PQExpBufferDataBroken, and termPQExpBuffer().
Referenced by copy_connection(), do_connect(), GenerateRecoveryConfig(), libpqrcv_get_conninfo(), and test_protocol_version().
void PQconninfoFree | ( | PQconninfoOption * | connOptions | ) |
Definition at line 7434 of file fe-connect.c.
References free, and option::val.
Referenced by check_pghost_envvar(), ConnectDatabase(), connectOptions1(), conninfo_array_parse(), conninfo_parse(), conninfo_uri_parse(), dblink_connstr_has_pw(), dblink_connstr_has_required_scram_options(), do_connect(), GenerateRecoveryConfig(), get_base_conninfo(), GetConnection(), GetDbnameFromConnectionOptions(), libpqrcv_check_conninfo(), libpqrcv_get_conninfo(), libpqrcv_get_dbname_from_conninfo(), PQconndefaults(), and PQconnectStartParams().
PQconninfoOption * PQconninfoParse | ( | const char * | conninfo, |
char ** | errmsg | ||
) |
Definition at line 6150 of file fe-connect.c.
References PQExpBufferData::data, errmsg(), initPQExpBuffer(), parse_connection_string(), PQExpBufferDataBroken, and termPQExpBuffer().
Referenced by ConnectDatabase(), dblink_connstr_has_pw(), dblink_connstr_has_required_scram_options(), do_connect(), get_base_conninfo(), GetConnection(), GetDbnameFromConnectionOptions(), libpqrcv_check_conninfo(), libpqrcv_get_dbname_from_conninfo(), and main().
Definition at line 1025 of file fe-connect.c.
References free, libpq_append_conn_error(), and PQconninfoOptions.
Referenced by PQcancelCreate().
char * PQdb | ( | const PGconn * | conn | ) |
Definition at line 7447 of file fe-connect.c.
References conn, and pg_conn::dbName.
Referenced by append_rel_pattern_filtered_cte(), cluster_one_database(), do_connect(), exec_command_conninfo(), find_matching_idle_slot(), get_prompt(), GetTableInfo(), main(), prohibit_crossdb_refs(), reindex_one_database(), run_command(), run_reindex_command(), run_vacuum_command(), slashUsage(), SyncVariables(), TableCommandResultHandler(), vacuum_one_database(), validateSQLNamePattern(), and WriteHead().
void pqDropConnection | ( | PGconn * | conn, |
bool | flushInput | ||
) |
Definition at line 520 of file fe-connect.c.
References pg_conn::altsock, pg_conn::async_auth, pg_conn::cleanup_async_auth, closesocket, pg_conn::cmd_queue_head, pg_conn::cmd_queue_recycle, pg_conn::cmd_queue_tail, conn, free, pg_fe_sasl_mech::free, pg_conn::inCursor, pg_conn::inEnd, pg_conn::inStart, pg_conn::outCount, PGINVALID_SOCKET, pqFreeCommandQueue(), pqsecure_close(), pg_conn::sasl, pg_conn::sasl_state, and pg_conn::sock.
Referenced by handleSyncLoss(), pqClosePGconn(), pqConnectDBStart(), PQconnectPoll(), and pqReadData().
|
static |
Definition at line 646 of file fe-connect.c.
References pg_conn::auth_req_received, pg_conn::be_cancel_key, pg_conn::be_cancel_key_len, pg_conn::be_pid, pg_conn::cancelRequest, pg_conn::client_encoding, pg_conn::client_finished_auth, conn, pg_conn::default_transaction_read_only, free, pg_conn::gssapi_used, pg_conn::in_hot_standby, pg_conn::last_sqlstate, pg_conn::lobjfuncs, pgNotify::next, pgParameterStatus::next, pg_conn::notifyHead, pg_conn::notifyTail, pg_conn::oauth_want_retry, pg_conn::password_needed, PG_BOOL_UNKNOWN, PG_SQL_ASCII, pg_conn::pstatus, pg_conn::pversion_negotiated, SCRAM_SHA_256_DEFAULT_ITERATIONS, pg_conn::scram_sha_256_iterations, pg_conn::std_strings, pg_conn::sversion, pg_conn::write_err_msg, and pg_conn::write_failed.
Referenced by pqClosePGconn(), and PQconnectPoll().
char * PQerrorMessage | ( | const PGconn * | conn | ) |
Definition at line 7619 of file fe-connect.c.
References conn, PQExpBufferData::data, pg_conn::errorMessage, libpq_gettext, and PQExpBufferBroken.
Referenced by _doSetSessionAuth(), _printTableAccessMethodNoStorage(), _selectOutputSchema(), _selectTableAccessMethod(), _selectTablespace(), AcceptResult(), advanceConnectionState(), BaseBackup(), check_loadable_libraries(), check_prepare_conn(), CheckCopyStreamStop(), cluster_one_database(), compile_database_list(), compile_relation_list_one_db(), confirm_query_canceled_impl(), connect_database(), connect_pg_server(), ConnectDatabase(), connectDatabase(), connectToServer(), copy_connection(), CopyStreamPoll(), CopyStreamReceive(), CreateReplicationSlot(), dblink_connect(), dblink_error_message(), dblink_get_conn(), dblink_res_error(), dblink_res_internalerror(), dblink_send_query(), DescribeQuery(), die_on_query_failure(), do_connect(), do_lo_export(), do_lo_import(), do_lo_unlink(), doConnect(), DropReplicationSlot(), dump_lo_buf(), dumpLOs(), dumpTableData_copy(), ecpg_check_PQresult(), ecpg_raise_backend(), ECPGconnect(), EndDBCopyMode(), escape_identifier(), escape_literal(), escape_string_conn(), exec_command_password(), ExecQueryAndProcessResults(), executeCommand(), executeQuery(), executeQueryOrDie(), ExecuteSqlCommand(), ExecuteSqlCommandBuf(), executeStatement(), get_table_relkind(), GetConnection(), GetSlotInformation(), GetTableInfo(), handleCopyIn(), handleCopyOut(), HandleEndOfCopyStream(), initPopulateTable(), libpqrcv_alter_slot(), libpqrcv_connect(), libpqrcv_create_slot(), libpqrcv_endstreaming(), libpqrcv_exec(), libpqrcv_identify_system(), libpqrcv_readtimelinehistoryfile(), libpqrcv_receive(), libpqrcv_send(), libpqrcv_startstreaming(), main(), my_truncate(), overwrite(), pgfdw_cancel_query_end(), pgfdw_report_error(), pickout(), PQcancelErrorMessage(), prepareCommand(), process_global_sql_commands(), process_query_result(), process_queued_fetch_requests(), process_result(), process_slot(), ProcessXLogDataMsg(), psql_get_variable(), readCommandResponse(), ReceiveCopyData(), RetrieveDataDirCreatePerm(), RetrieveWalSegSize(), run_command(), run_permutation(), run_reindex_command(), run_vacuum_command(), RunIdentifySystem(), send_cancellable_query_impl(), sendFeedback(), SendQuery(), sql_conn(), sql_exec(), start_postmaster(), StartRestoreLO(), storeQueryResult(), StreamLogicalLog(), TableCommandResultHandler(), test_cancel(), test_disallowed_in_pipeline(), test_multi_pipelines(), test_nosync(), test_one_vector(), test_pipeline_abort(), test_pipeline_idle(), test_pipelined_insert(), test_prepared(), test_protocol_version(), test_simple_pipeline(), test_singlerowmode(), test_transaction(), test_uniqviol(), threadRun(), try_complete_step(), tryExecuteStatement(), vacuumlo(), verify_btree_slot_handler(), verify_heap_slot_handler(), and wait_for_connection_state().
void PQfinish | ( | PGconn * | conn | ) |
Definition at line 5290 of file fe-connect.c.
References conn, freePGconn(), and pqClosePGconn().
Referenced by appendQualifiedRelation(), BaseBackup(), 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(), CheckConnection(), cluster_all_databases(), cluster_one_database(), connect_database(), ConnectDatabase(), connectDatabase(), connectToServer(), create_logical_replication_slots(), create_new_objects(), disconnect_atexit(), disconnect_database(), DisconnectDatabase(), disconnectDatabase(), do_connect(), doConnect(), dumpRoleGUCPrivs(), dumpRoleMembership(), dumpTablespaces(), ecpg_finish(), executeCommand(), executeQuery(), executeQueryOrDie(), exit_nicely(), expand_dbname_patterns(), finishCon(), get_db_infos(), get_dbnames_list_to_restore(), get_subscription_count(), get_tablespace_paths(), get_template0_info(), GetConnection(), libpqsrv_connect_internal(), libpqsrv_disconnect(), LogStreamerMain(), main(), old_9_6_invalidate_hash_indexes(), PQcancelFinish(), PQping(), PQpingParams(), process_slot(), ReconnectToServer(), reindex_all_databases(), reindex_one_database(), restore_all_databases(), runInitSteps(), set_frozenxids(), set_locale_and_encoding(), sql_conn(), sql_exec(), start_postmaster(), StreamLog(), StreamLogicalLog(), test_protocol_version(), unicode_version_changed(), vacuum_all_databases(), vacuum_one_database(), and vacuumlo().
|
static |
Definition at line 620 of file fe-connect.c.
References cur, free, and cursor::next.
Referenced by pqDropConnection().
int PQfullProtocolVersion | ( | const PGconn * | conn | ) |
Definition at line 7599 of file fe-connect.c.
References conn, CONNECTION_BAD, PG_PROTOCOL_FULL, pg_conn::pversion, and pg_conn::status.
Referenced by test_protocol_version().
bool pqGetHomeDirectory | ( | char * | buf, |
int | bufsize | ||
) |
Definition at line 8136 of file fe-connect.c.
References buf, bufsize, snprintf, strlcpy(), and tmpbuf.
Referenced by initialize_SSL(), parseServiceInfo(), and pqConnectOptions2().
char * PQhost | ( | const PGconn * | conn | ) |
Definition at line 7488 of file fe-connect.c.
References conn, pg_conn::connhost, pg_conn_host::host, pg_conn_host::hostaddr, and pg_conn::whichhost.
Referenced by do_connect(), exec_command_conninfo(), get_prompt(), libpqrcv_get_senderinfo(), main(), pg_GSS_load_servicename(), and SyncVariables().
char * PQhostaddr | ( | const PGconn * | conn | ) |
Definition at line 7511 of file fe-connect.c.
References conn, pg_conn::connhost, and pg_conn::connip.
Referenced by do_connect(), and exec_command_conninfo().
PGconn * pqMakeEmptyPGconn | ( | void | ) |
Definition at line 4937 of file fe-connect.c.
References pg_conn::altsock, pg_conn::asyncStatus, pg_conn::client_encoding, conn, CONNECTION_BAD, pg_conn::default_transaction_read_only, defaultNoticeProcessor(), defaultNoticeReceiver(), pg_conn::errorMessage, freePGconn(), pg_conn::in_hot_standby, pg_conn::inBuffer, pg_conn::inBufSize, initPQExpBuffer(), malloc, MemSet, pg_conn::nonblocking, pg_conn::noticeHooks, PGNoticeHooks::noticeProc, PGNoticeHooks::noticeRec, pg_conn::options_valid, pg_conn::outBuffer, pg_conn::outBufSize, pg_conn::Pfdebug, PG_BOOL_UNKNOWN, PG_SQL_ASCII, PGASYNC_IDLE, PGINVALID_SOCKET, pg_conn::pipelineStatus, PQ_PIPELINE_OFF, PQERRORS_DEFAULT, PQExpBufferBroken, PQSHOW_CONTEXT_ERRORS, PQTRANS_IDLE, pg_conn::rowBuf, pg_conn::rowBufLen, SCRAM_SHA_256_DEFAULT_ITERATIONS, pg_conn::scram_sha_256_iterations, pg_conn::show_context, pg_conn::sock, pg_conn::status, pg_conn::std_strings, pg_conn::verbosity, pg_conn::workBuffer, and pg_conn::xactStatus.
Referenced by PQcancelCreate(), PQconnectStart(), PQconnectStartParams(), and PQsetdbLogin().
char * PQoptions | ( | const PGconn * | conn | ) |
Definition at line 7548 of file fe-connect.c.
References conn, and pg_conn::pgoptions.
Referenced by exec_command_conninfo().
int pqPacketSend | ( | PGconn * | conn, |
char | pack_type, | ||
const void * | buf, | ||
size_t | buf_len | ||
) |
Definition at line 5398 of file fe-connect.c.
References buf, conn, pqFlush(), pqPutMsgEnd(), pqPutMsgStart(), pqPutnchar(), STATUS_ERROR, and STATUS_OK.
Referenced by pg_password_sendauth(), pg_SASL_continue(), and PQconnectPoll().
const char * PQparameterStatus | ( | const PGconn * | conn, |
const char * | paramName | ||
) |
Definition at line 7574 of file fe-connect.c.
References conn, pgParameterStatus::name, pgParameterStatus::next, pg_conn::pstatus, and pgParameterStatus::value.
Referenced by _check_database_version(), applyRemoteGucs(), BaseBackup(), CheckServerVersionForStreaming(), ConnectDatabase(), connection_warnings(), ecpg_build_params(), exec_command_conninfo(), GetConnection(), is_superuser(), main(), printVersion(), session_username(), setup_connection(), standard_strings(), and SyncVariables().
bool pqParseIntParam | ( | const char * | value, |
int * | result, | ||
PGconn * | conn, | ||
const char * | context | ||
) |
Definition at line 8177 of file fe-connect.c.
References Assert(), conn, error(), libpq_append_conn_error(), and value.
Referenced by pqConnectDBComplete(), PQconnectPoll(), PQgetCancel(), setKeepalivesCount(), setKeepalivesIdle(), setKeepalivesInterval(), setTCPUserTimeout(), and useKeepalives().
|
static |
Definition at line 8222 of file fe-connect.c.
References conn, libpq_append_conn_error(), PG_PROTOCOL, PG_PROTOCOL_LATEST, and value.
Referenced by pqConnectOptions2().
char * PQpass | ( | const PGconn * | conn | ) |
Definition at line 7471 of file fe-connect.c.
References conn, pg_conn::connhost, password, pg_conn_host::password, pg_conn::pgpass, and pg_conn::whichhost.
Referenced by ConnectDatabaseAhx(), and PQconnectionNeedsPassword().
PGPing PQping | ( | const char * | conninfo | ) |
Definition at line 829 of file fe-connect.c.
References conn, internal_ping(), PQconnectStart(), and PQfinish().
PGPing PQpingParams | ( | const char *const * | keywords, |
const char *const * | values, | ||
int | expand_dbname | ||
) |
Definition at line 776 of file fe-connect.c.
References conn, internal_ping(), keywords, PQconnectStartParams(), PQfinish(), and values.
Referenced by main(), and regression_main().
PGpipelineStatus PQpipelineStatus | ( | const PGconn * | conn | ) |
Definition at line 7663 of file fe-connect.c.
References conn, pg_conn::pipelineStatus, and PQ_PIPELINE_OFF.
Referenced by advanceConnectionState(), exec_command_g(), exec_command_gexec(), exec_command_gset(), exec_command_sendpipeline(), exec_command_watch(), ExecQueryAndProcessResults(), executeMetaCommand(), get_prompt(), test_disallowed_in_pipeline(), test_multi_pipelines(), test_pipeline_abort(), and test_simple_pipeline().
char * PQport | ( | const PGconn * | conn | ) |
Definition at line 7524 of file fe-connect.c.
References conn, pg_conn::connhost, pg_conn_host::port, and pg_conn::whichhost.
Referenced by do_connect(), exec_command_conninfo(), get_prompt(), libpqrcv_get_senderinfo(), main(), and SyncVariables().
int PQprotocolVersion | ( | const PGconn * | conn | ) |
Definition at line 7589 of file fe-connect.c.
References conn, CONNECTION_BAD, PG_PROTOCOL_MAJOR, pg_conn::pversion, and pg_conn::status.
Referenced by exec_command_conninfo(), and handleCopyIn().
pgthreadlock_t PQregisterThreadLock | ( | pgthreadlock_t | newhandler | ) |
Definition at line 8277 of file fe-connect.c.
References default_threadlock(), and pg_g_threadlock.
void pqReleaseConnHosts | ( | PGconn * | conn | ) |
Definition at line 5127 of file fe-connect.c.
References conn, pg_conn::connhost, explicit_bzero(), free, pg_conn_host::host, pg_conn_host::hostaddr, i, pg_conn::nconnhost, pg_conn_host::password, and pg_conn_host::port.
Referenced by freePGconn(), and PQcancelCreate().
void PQreset | ( | PGconn * | conn | ) |
Definition at line 5304 of file fe-connect.c.
References conn, PGEventConnReset::conn, pg_conn::events, i, pg_conn::nEvents, PGEvent::passThrough, PGEVT_CONNRESET, pqClosePGconn(), pqConnectDBComplete(), pqConnectDBStart(), and PGEvent::proc.
Referenced by CheckConnection().
PostgresPollingStatusType PQresetPoll | ( | PGconn * | conn | ) |
Definition at line 5356 of file fe-connect.c.
References conn, PGEventConnReset::conn, pg_conn::events, i, pg_conn::nEvents, PGEvent::passThrough, PGEVT_CONNRESET, PGRES_POLLING_FAILED, PGRES_POLLING_OK, PQconnectPoll(), and PGEvent::proc.
int PQresetStart | ( | PGconn * | conn | ) |
Definition at line 5337 of file fe-connect.c.
References conn, pqClosePGconn(), and pqConnectDBStart().
int PQserverVersion | ( | const PGconn * | conn | ) |
Definition at line 7609 of file fe-connect.c.
References conn, CONNECTION_BAD, pg_conn::status, and pg_conn::sversion.
Referenced by _check_database_version(), appendStringLiteralConn(), BaseBackup(), CheckServerVersionForStreaming(), configure_remote_session(), ConnectDatabase(), CreateReplicationSlot(), dumpRoleMembership(), GenerateRecoveryConfig(), GetConnection(), initPopulateTable(), libpqrcv_create_slot(), libpqrcv_server_version(), libpqrcv_startstreaming(), main(), postgresAcquireSampleRowsFunc(), postgresImportForeignSchema(), postgresReScanForeignScan(), printVersion(), processSQLNamePattern(), ReceiveTarFile(), reindex_one_database(), RetrieveDataDirCreatePerm(), RetrieveWalSegSize(), RunIdentifySystem(), StartLogStreamer(), StreamLog(), SyncVariables(), vacuum_one_database(), vacuumlo(), and WriteRecoveryConfig().
char * PQservice | ( | const PGconn * | conn | ) |
Definition at line 7455 of file fe-connect.c.
References conn, and pg_conn::pgservice.
Referenced by get_prompt(), and SyncVariables().
int PQsetClientEncoding | ( | PGconn * | conn, |
const char * | encoding | ||
) |
Definition at line 7717 of file fe-connect.c.
References conn, CONNECTION_OK, encoding, pg_encoding_to_char, pg_get_encoding_from_locale(), PGRES_COMMAND_OK, PQclear(), PQexec(), pg_result::resultStatus, sprintf, and pg_conn::status.
Referenced by dblink_connect(), dblink_get_conn(), exec_command_encoding(), main(), setup_connection(), and test_one_vector().
PGconn * PQsetdbLogin | ( | const char * | pghost, |
const char * | pgport, | ||
const char * | pgoptions, | ||
const char * | pgtty, | ||
const char * | dbName, | ||
const char * | login, | ||
const char * | pwd | ||
) |
Definition at line 2228 of file fe-connect.c.
References conn, CONNECTION_BAD, connectOptions1(), dbName, pg_conn::dbName, free, libpq_append_conn_error(), pghost, pg_conn::pghost, pg_conn::pgoptions, pg_conn::pgpass, pgport, pg_conn::pgport, pg_conn::pguser, pqConnectDBComplete(), pqConnectDBStart(), pqConnectOptions2(), pqMakeEmptyPGconn(), recognized_connection_string(), and pg_conn::status.
PGContextVisibility PQsetErrorContextVisibility | ( | PGconn * | conn, |
PGContextVisibility | show_context | ||
) |
Definition at line 7771 of file fe-connect.c.
References conn, PQSHOW_CONTEXT_ERRORS, and pg_conn::show_context.
Referenced by show_context_hook(), and SyncVariables().
PGVerbosity PQsetErrorVerbosity | ( | PGconn * | conn, |
PGVerbosity | verbosity | ||
) |
Definition at line 7759 of file fe-connect.c.
References conn, PQERRORS_DEFAULT, and pg_conn::verbosity.
Referenced by main(), SyncVariables(), and verbosity_hook().
PQnoticeProcessor PQsetNoticeProcessor | ( | PGconn * | conn, |
PQnoticeProcessor | proc, | ||
void * | arg | ||
) |
Definition at line 7800 of file fe-connect.c.
References arg, conn, pg_conn::noticeHooks, PGNoticeHooks::noticeProc, and PGNoticeHooks::noticeProcArg.
Referenced by ConnectDatabaseAhx(), do_connect(), main(), and test_pipeline_idle().
PQnoticeReceiver PQsetNoticeReceiver | ( | PGconn * | conn, |
PQnoticeReceiver | proc, | ||
void * | arg | ||
) |
Definition at line 7783 of file fe-connect.c.
References arg, conn, pg_conn::noticeHooks, PGNoticeHooks::noticeRec, and PGNoticeHooks::noticeRecArg.
Referenced by ECPGconnect().
int PQsocket | ( | const PGconn * | conn | ) |
Definition at line 7645 of file fe-connect.c.
References pg_conn::altsock, conn, PGINVALID_SOCKET, and pg_conn::sock.
Referenced by connect_slot(), CopyStreamPoll(), libpqrcv_receive(), libpqsrv_connect_internal(), libpqsrv_get_result(), main(), pgfdw_conn_check(), pgfdw_get_cleanup_result(), postgresForeignAsyncConfigureWait(), PQcancelSocket(), StreamLogicalLog(), test_nosync(), test_pipelined_insert(), test_uniqviol(), threadRun(), try_complete_step(), wait_on_slots(), and wait_until_connected().
ConnStatusType PQstatus | ( | const PGconn * | conn | ) |
Definition at line 7556 of file fe-connect.c.
References conn, CONNECTION_BAD, and pg_conn::status.
Referenced by check_prepare_conn(), connect_database(), connect_pg_server(), ConnectDatabase(), connectDatabase(), ConnectionUp(), connectToServer(), copy_connection(), dblink_connect(), dblink_get_conn(), do_connect(), doConnect(), ecpg_raise_backend(), ECPGconnect(), GetConnection(), getTransactionStatus(), libpqrcv_connect(), libpqrcv_receive(), libpqsrv_connect_internal(), libpqsrv_get_result_last(), main(), pgfdw_conn_check(), pgfdw_finish_pre_commit_cleanup(), pgfdw_reset_xact_state(), PQcancelStatus(), process_query_result(), sql_conn(), start_postmaster(), test_cancel(), test_protocol_version(), and vacuumlo().
PGTransactionStatusType PQtransactionStatus | ( | const PGconn * | conn | ) |
Definition at line 7564 of file fe-connect.c.
References pg_conn::asyncStatus, conn, CONNECTION_OK, PGASYNC_IDLE, PQTRANS_ACTIVE, PQTRANS_UNKNOWN, pg_conn::status, and pg_conn::xactStatus.
Referenced by dblink_open(), DisconnectDatabase(), disconnectDatabase(), ecpg_autostart_transaction(), ECPGsetcommit(), ECPGtrans(), ECPGtransactionStatus(), get_prompt(), getTransactionStatus(), pgfdw_abort_cleanup(), pgfdw_abort_cleanup_begin(), pgfdw_reset_xact_state(), SendQuery(), start_lo_xact(), and vacuumlo().
char * PQtty | ( | const PGconn * | conn | ) |
Definition at line 7540 of file fe-connect.c.
References conn.
char * PQuser | ( | const PGconn * | conn | ) |
Definition at line 7463 of file fe-connect.c.
References conn, and pg_conn::pguser.
Referenced by do_connect(), exec_command_conninfo(), get_prompt(), main(), process_global_sql_commands(), session_username(), and SyncVariables().
|
static |
Definition at line 7850 of file fe-connect.c.
Referenced by passwordFromFile().
|
static |
Definition at line 6254 of file fe-connect.c.
References connstr, and uri_prefix_length().
Referenced by conninfo_array_parse(), and PQsetdbLogin().
|
static |
Definition at line 5195 of file fe-connect.c.
References pg_conn::addr, conn, and free.
Referenced by freePGconn(), pqClosePGconn(), and PQconnectPoll().
|
static |
Definition at line 4798 of file fe-connect.c.
References pg_conn::allowed_enc_methods, conn, pg_conn::current_enc_method, ENC_ERROR, ENC_GSSAPI, ENC_PLAINTEXT, ENC_SSL, pg_conn::gssencmode, libpq_append_conn_error(), pg_GSS_have_cred_cache(), SELECT_NEXT_METHOD, and pg_conn::sslmode.
Referenced by connection_failed(), and init_allowed_encryption_methods().
|
static |
Definition at line 5209 of file fe-connect.c.
References pg_conn::cancelRequest, conn, CONNECTION_OK, PGINVALID_SOCKET, pqFlush(), PqMsg_Terminate, pqPutMsgEnd(), pqPutMsgStart(), pg_conn::sock, and pg_conn::status.
Referenced by pqClosePGconn(), and PQconnectPoll().
|
static |
Definition at line 2565 of file fe-connect.c.
References conn, pg_conn::keepalives_count, libpq_append_conn_error(), PG_STRERROR_R_BUFLEN, pqParseIntParam(), pg_conn::sock, SOCK_ERRNO, and SOCK_STRERROR.
Referenced by PQconnectPoll().
|
static |
Definition at line 2496 of file fe-connect.c.
References conn, pg_conn::keepalives_idle, libpq_append_conn_error(), PG_STRERROR_R_BUFLEN, pqParseIntParam(), pg_conn::sock, SOCK_ERRNO, and SOCK_STRERROR.
Referenced by PQconnectPoll().
|
static |
Definition at line 2530 of file fe-connect.c.
References conn, pg_conn::keepalives_interval, libpq_append_conn_error(), PG_STRERROR_R_BUFLEN, pqParseIntParam(), pg_conn::sock, SOCK_ERRNO, and SOCK_STRERROR.
Referenced by PQconnectPoll().
|
static |
Definition at line 2662 of file fe-connect.c.
References conn, libpq_append_conn_error(), pg_conn::pgtcp_user_timeout, pqParseIntParam(), pg_conn::sock, SOCK_ERRNO, and SOCK_STRERROR.
Referenced by PQconnectPoll().
|
static |
Definition at line 8083 of file fe-connect.c.
References Assert(), pg_strcasecmp(), and sslVerifyProtocolVersion().
Referenced by pqConnectOptions2().
|
static |
Definition at line 8057 of file fe-connect.c.
References pg_strcasecmp().
Referenced by pqConnectOptions2(), and sslVerifyProtocolRange().
|
static |
Definition at line 5156 of file fe-connect.c.
References SockAddr::addr, AddrInfo::addr, pg_conn::addr, calloc, conn, AddrInfo::family, i, libpq_append_conn_error(), pg_conn::naddr, SockAddr::salen, and pg_conn::whichaddr.
Referenced by PQconnectPoll().
|
static |
Definition at line 6231 of file fe-connect.c.
References connstr, short_uri_designator, and uri_designator.
Referenced by conninfo_uri_parse_options(), parse_connection_string(), and recognized_connection_string().
|
static |
Definition at line 2478 of file fe-connect.c.
References conn, pg_conn::keepalives, pqParseIntParam(), and val.
Referenced by PQconnectPoll().
|
static |
Definition at line 413 of file fe-connect.c.
Referenced by PQconnectPoll().
pgthreadlock_t pg_g_threadlock = default_threadlock |
Definition at line 504 of file fe-connect.c.
Referenced by PQregisterThreadLock().
|
static |
Definition at line 193 of file fe-connect.c.
Referenced by conninfo_init(), fillPGconn(), PQconninfo(), and pqCopyPGconn().
|
static |
Definition at line 440 of file fe-connect.c.
Referenced by uri_prefix_length().
|
static |
Definition at line 431 of file fe-connect.c.
Referenced by fill_allowed_sasl_mechs().
|
static |
Definition at line 439 of file fe-connect.c.
Referenced by uri_prefix_length().