PostgreSQL connection lifecycle, I/O, simple-query protocol, statement cache and LISTEN/NOTIFY support.
This module is a thin re-export hub. The actual implementation lives in the pg_connection/ subdirectory:
- pg_connection/types — PgConnection, ConnConfig, the tracing data types, the PgTracer hook record, and the tracing helper templates (withConnTracing, withTracing).
- pg_connection/dsn — DSN parsing (URI and libpq keyword=value formats) plus initConnConfig and parseDsn.
- pg_connection/buffer_io — recv/send buffering (fillRecvBuf, nextMessage, recvMessage, sendMsg), TCP keepalive, closeTransport, notification/notice dispatch, isConnected / socketHasFin, and the getHosts host helper.
- pg_connection/ssl — SSL negotiation (negotiateSSL) for chronos+BearSSL and asyncdispatch+OpenSSL.
- pg_connection/cache — client-side prepared-statement LRU.
- pg_connection/simple_query — simple-query / simple-exec / ping, cancel / invalidateOnTimeout, checkSessionAttrs, quoteIdentifier, QueryResult helpers.
- pg_connection/lifecycle — connect / connectToHost / close, orderedHosts (load-balanced host ordering) and the SCRAM/require_auth helpers.
- pg_connection/notify — LISTEN/NOTIFY pump, waitNotification, reconnectInPlace.
- pg_connection/type_lookup — lookupTypeOids generic helper to resolve type names to OIDs via to_regtype (extension types like hstore, citext, etc.).
Only the public API listed below is re-exported. Anything not listed stays in its defining submodule (e.g. pg_connection/buffer_io) and must be imported from there directly, not through import pg_connection.
Exports
-
ErrorField, isQueryCanceled, PgError, SqlStateSyntaxError, PgStateError, SqlStateQueryCanceled, SqlStateUniqueViolation, SqlStateForeignKeyViolation, PgNotifyOverflowError, position, newPoolError, SqlStateNotNullViolation, isForeignKeyViolation, PoolErrorKind, SqlStateSerializationFailure, isIntegrityConstraintViolation, tableName, SqlStateExclusionViolation, PgTimeoutError, isCheckViolation, isExclusionViolation, errorField, where, SqlStateCheckViolation, constraintName, PgConnectionError, isSerializationFailure, isUniqueViolation, internalPosition, isDeadlockDetected, PgQueryError, PgTypeError, PgListenError, PgProtocolError, isNotNullViolation, dataTypeName, SqlStateDeadlockDetected, internalQuery, PgPoolError, SqlStateUndefinedTable, ProtocolError, PgNoRowsError, PgNullError, columnName, schemaName, getErrorField, PgConnState, SslMode, SslNegotiation, ChannelBindingMode, AuthMethod, TargetSessionAttrs, LoadBalanceHosts, HostEntry, ConnConfig, PgTracer, Notification, NotifyCallback, Notice, NoticeCallback, CachedStmt, dialAddr, displayHost, QueryResult, CopyResult, CopyOutInfo, CopyInInfo, CopyOutCallback, CopyInCallback, PgPoolOwner, PgConnection, RowCallback, ClientCertPairingErrorMsg, TraceContext, TraceCopyDirection, TraceConnectStartData, TraceConnectEndData, TraceQueryStartData, TraceQueryEndData, TracePrepareStartData, TracePrepareEndData, TracePipelineStartData, TracePipelineEndData, TraceCopyStartData, TraceCopyEndData, TracePoolAcquireStartData, TracePoolAcquireEndData, TracePoolReleaseStartData, TracePoolReleaseEndData, TracePoolDoubleReleaseData, TracePoolCloseErrorData, TraceTransportCloseErrorData, TransportCloseStage, CleanupKind, CleanupSkipReason, TraceCleanupSkippedData, TraceLeakedSessionLocksData, TraceInsecureAuthData, TraceDeprecatedAuthData, TraceAdvisoryUnlockFailedData, withConnTracing, withTracing, initConnConfig, parseDsn, isUnixSocket, unixSocketPath, getHosts, makeCopyOutCallback, makeCopyInCallback, socketHasFin, socketHasPendingData, isConnected, len, columnIndex, rows, items, quoteIdentifier, cancel, cancelNoWait, invalidateOnTimeout, simpleExec, simpleQuery, ping, checkSessionAttrs, close, orderedHosts, connect, connect, connectToHost, onNotify, onListenError, listen, unlisten, waitNotification, TypeOidInfo, lookupTypeOids