async_postgres

Async PostgreSQL client for Nim.

Implements the PostgreSQL wire protocol v3 with full support for the extended query protocol, connection pooling, SSL/TLS, and binary format optimization.

Async Backend

Select at compile time with -d:asyncBackend=asyncdispatch (default) or -d:asyncBackend=chronos.

TLS backend differences

asyncdispatch uses OpenSSL (-d:ssl) and chronos uses BearSSL (via nim-bearssl).

Behaviorasyncdispatch (OpenSSL)chronos (BearSSL)
Negotiated TLS1.2 minimum, 1.3 when offeredPinned to 1.2
Expired/not-yet-valid certAccepted (not verified) under allow/prefer, and require without sslrootcertHandshake fails with PgConnectionError
IP host, verify-fullVerifies IP SANs (PgSecurityError if OpenSSL lacks SSL_get0_param or X509_VERIFY_PARAM_set1_ip_asc)Refused with PgSecurityError (dNSName SAN only)
SNIEvery sslmode (except IP/empty host, a host name of 256 bytes or more, or sslsni=0)verify-full only; sslsni has no effect
Host name >= 256 bytesUnder verify-full: verified; the ClientHello carries no SNI, with no noticeUnder verify-full: refused with PgSecurityError
TRUSTED CERTIFICATEIn sslrootcert (openssl x509 -trustout): aux trust settings honoured Skipped, so the CA is not trusted (PgConfigError if no other CA is left); export CAs as plain CERTIFICATE
sslrootcert=systemOpenSSL's default paths, as libpq: SSL_CERT_FILE and SSL_CERT_DIR or the build's OPENSSLDIR; with no root there the handshake fails (PgSecurityError) SSL_CERT_FILE, else the hashed names in SSL_CERT_DIR, else the first bundle std/ssl_certs finds (Windows: cacert.pem beside the program or on PATH); none is a PgConfigError
Root CA without CA:TRUEAccepted as a CA with keyUsage keyCertSign; a bare root and CA:FALSE are refused as a CARefused as a CA with PgSecurityError
Client cert, key, root CAStaged as temp files (owner-only on POSIX, /dev/shm preferred on Linux), deleted once loadedDecoded in memory
ALPN postgresqlSent unless libssl lacks SSL_CTX_set_alpn_protos (then traditional mode sends none and direct mode fails); if that call errors, the connect fails in either modeAlways sent

A certificate refused as a CA (CA:FALSE, or a root OpenSSL rates not CA-capable) is still usable as a direct pin: with the server's own certificate in sslrootcert, both backends verify it — BearSSL matches the DN and public key, whatever the CA flag says.

Both backends trust only the pinned sslrootcert, or the system's roots with sslrootcert=system (never the Windows or macOS certificate store), enforce ALPN for sslnegotiation=direct only, and drop from SCRAM-SHA-256-PLUS to SCRAM-SHA-256 under channel_binding=prefer when the server certificate is unavailable (require fails the connect on both).

sslrootcert is checked under verify-ca / verify-full, and under require when one is set, as in libpq; allow / prefer leave it unused. A DSN's sslrootcert= is read while the DSN is parsed, whatever the mode, so a missing or unreadable file is a PgConfigError. parseDsn also reads libpq's default ~/.postgresql/root.crt, postgresql.crt and postgresql.key (see parseDsn). sslrootcert=system (ConnConfig.sslRootCertSystem) takes verify-full only, which parseDsn sets when no sslmode is given, as libpq does; both backends read the system's roots on each connection.

Downgrade and fallback notices

These go to stderr only, one pg_connection: line per event:

  • the sslmode=prefer plaintext fallback after the server refuses SSL
  • a client certificate that will not be sent (no TLS support, a Unix-socket connection, or that plaintext fallback, which then writes two lines), unless it is libpq's default postgresql.crt, which libpq drops silently
  • channel_binding=prefer passing over an offered SCRAM-SHA-256-PLUS for lack of a server certificate (written once startup completes)
  • temp-file cleanup failures

They are not reported to PgTracer and cannot be hooked, filtered, or suppressed. The plaintext fallback can be detected afterwards with:

hasTls and conn.config.sslMode == sslPrefer and not conn.sslEnabled and
  not isUnixSocket(conn.host)

Any other plaintext connection is expected, not a fallback. To refuse it, check the connect result or raise from PoolConfig.afterConnect; PgTracer.onConnectEnd can only observe it (data.conn when data.err is nil). All three run after the startup and authentication exchange has crossed the plaintext link: only sslmode=require or stronger prevents that. The LISTEN pump's in-place reconnect skips the first two, and onConnectEnd then gets a temporary connection, not the listener: check the listener in conn.onReconnect, which fires once its channels are re-listened.

Quick Start

import pkg/async_postgres

proc main() {.async.} =
  let conn = await connect("postgresql://myuser:mypass@127.0.0.1:5432/mydb")
  defer: await conn.close()
  
  # Insert with typed parameters
  let name = "Alice"
  let age = 30'i32
  let cr = await conn.exec(sql"INSERT INTO users (name, age) VALUES ({name}, {age})")
  echo "Inserted: ", cr.affectedRows
  
  # Query multiple rows
  let minAge = 25'i32
  let row = await conn.query(sql"SELECT id, name, age FROM users WHERE age > {minAge}")
  for r in row:
    echo r.getStr("name"), " age=", r.getInt("age")
  
  # Query a single value
  let count = await conn.queryValueOrDefault("SELECT count(*) FROM users", default = "0")
  echo "Total users: ", count

waitFor main()

Mapping rows to objects

row.to(T) reads a row into an object, a ref object or a tuple, and qr.to(seq[T]) reads every row. Each field reads the column its name matches, ignoring case and _; {.pgColumn: "name".} and {.pgSkip.} override that per field. See to in pg_types for the field types it reads.

type User = object
  id: int32
  name: string
  createdAt: DateTime
  email: Option[string]

let users = (await conn.query(
  "SELECT id, name, created_at, email FROM users")).to(seq[User])

Choosing a query API

Four parameterised entry points are provided. They differ in how parameters are supplied and in the amount of per-call allocation:

1. sql"..." macro — compile-time {expr} interpolation

Most readable. {expr} placeholders are rewritten to $1, $2, … at compile time and the expressions are collected into a seq[PgParam]. Works with query, exec, pool.query, cluster.withReadConnection, etc.

let name = "Alice"
await conn.query(sql"SELECT id FROM users WHERE name = {name}")
  • Pros: concise; compile-time placeholder rewriting; SQL injection-safe.
  • Cons: still allocates a seq[PgParam] per call; {expr} must be a compile-time-visible expression (not an openArray spread).
  • Use when: SQL is a literal and ergonomics matter more than zero-alloc.

2. query/exec with an explicit seq[PgParam]

The baseline runtime API. Use when the SQL or the parameter list is constructed dynamically (e.g. conditional WHERE clauses).

var params: seq[PgParam]
params.add name.toPgParam
params.add age.toPgParam
await conn.query("SELECT id FROM users WHERE name = $1 AND age > $2", params)

The pgParams(a, b, c) macro builds a seq[PgParam] in one call. A second overload takes seq[PgParamInline] — constructed manually as @[toPgParamInline(a), toPgParamInline(b)] — which avoids per-parameter heap allocations for scalar types.

3. queryDirect/execDirect — low-allocation macros

Encodes parameters directly into the connection's send buffer at compile time; no intermediate seq[PgParam] or seq[byte] is built.

let qr = await conn.queryDirect("SELECT name FROM users WHERE id = $1", myId)
  • Pros: no per-call allocations for the parameter path (building the QueryResult still allocates); same statement cache semantics as query.
  • Cons: SQL must be a string literal/compile-time constant; arguments are positional ($1, $2, …), no {expr} sugar.
  • Use when: the call site is on a hot path and params are scalars.

4. simpleQuery/simpleExec — simple query protocol

Parameter-less, text-only, single round trip. Allows multiple ;-separated statements and session-only commands that the extended protocol rejects (SET, LISTEN, VACUUM, …).

discard await conn.simpleExec("SET search_path TO myschema, public")

Quick decision table

SituationPrefer
Literal SQL, readabilitysql"..." macro
Dynamic SQL or paramsquery(sql, params) / exec
Hot path, scalar paramsqueryDirect / execDirect
SET / multi-statementsimpleQuery / simpleExec

sql"...", query/exec, and queryDirect/execDirect share the per-connection prepared-statement cache; simpleQuery/simpleExec use the simple protocol and are not cached. A timeout parameter is accepted by query/exec, queryDirect/execDirect, and simpleQuery/simpleExec; on timeout the connection is retired (csClosed) because the wire protocol desynchronises, unless the wire had settled (asyncdispatch always retires: the timed-out operation stays on the socket).

Client encoding

client_encoding is pinned to UTF8. A non-UTF8 value in the config (including -c client_encoding= in options) raises PgConfigError, and a session reporting a switch away (SET client_encoding) is closed with PgProtocolError. The switch is detected only after the fact, so do not change it within a query or pipeline.

Modules

  • pg_connection — Connection management, DSN parsing, SSL, LISTEN/NOTIFY
  • pg_client — Query execution, prepared statements, cursors, pipelines, transactions, COPY, low-alloc macros (queryDirect/execDirect)
  • pg_pool — Connection pooling with health checks and maintenance
  • pg_pool_cluster — Read replica pool cluster with automatic query routing
  • pg_types — Type conversions (toPgParam, row accessors, arrays, ranges, composites, enums)
  • pg_protocol — Wire protocol encoding/decoding
  • pg_largeobject — Large Object API for streaming binary data
  • pg_advisory_lock — Advisory lock API (session/transaction, exclusive/shared)
  • pg_replication — Logical replication streaming with pgoutput decoder
  • async_backend — Async framework abstraction (asyncdispatch / chronos)

Supported imports are pkg/async_postgres and the hub modules listed above. Importing a submodule directly (e.g. async_postgres/pg_connection/types) is unsupported and carries no compatibility guarantee; only the re-exported surface is covered by semantic versioning. Promised vs sibling * exports are frozen in tests/api_surface.{public,internal}.golden.

Exports

$, $, $, $, $, $, $, $, $, $, $, $, $, $, $, $, $, $, $, $, $, $, $, $, $, $, +, <, <, <=, <=, ==, ==, ==, ==, ==, ==, ==, ==, ==, ==, ==, ==, ==, ==, ==, ==, ==, ==, ==, ==, ==, ==, ==, ==, CommandResult, ErrorField, MaxMoneyScale, OidBit, OidBitArray, OidBool, OidBoolArray, OidBox, OidBoxArray, OidBpchar, OidBpcharArray, OidBytea, OidByteaArray, OidChar, OidCharArray, OidCidr, OidCidrArray, OidCircle, OidCircleArray, OidDate, OidDateArray, OidDateMultirange, OidDateMultirangeArray, OidDateRange, OidDateRangeArray, OidFloat4, OidFloat4Array, OidFloat8, OidFloat8Array, OidInet, OidInetArray, OidInt2, OidInt2Array, OidInt4, OidInt4Array, OidInt4Multirange, OidInt4MultirangeArray, OidInt4Range, OidInt4RangeArray, OidInt8, OidInt8Array, OidInt8Multirange, OidInt8MultirangeArray, OidInt8Range, OidInt8RangeArray, OidInterval, OidIntervalArray, OidJson, OidJsonArray, OidJsonb, OidJsonbArray, OidLine, OidLineArray, OidLseg, OidLsegArray, OidMacAddr, OidMacAddr8, OidMacAddr8Array, OidMacAddrArray, OidMoney, OidMoneyArray, OidName, OidNameArray, OidNumeric, OidNumericArray, OidNumMultirange, OidNumMultirangeArray, OidNumRange, OidNumRangeArray, OidPath, OidPathArray, OidPoint, OidPointArray, OidPolygon, OidPolygonArray, OidRecord, OidText, OidTextArray, OidTime, OidTimeArray, OidTimestamp, OidTimestampArray, OidTimestampTz, OidTimestampTzArray, OidTimeTz, OidTimeTzArray, OidTsMultirange, OidTsMultirangeArray, OidTsQuery, OidTsQueryArray, OidTsRange, OidTsRangeArray, OidTsTzMultirange, OidTsTzMultirangeArray, OidTsTzRange, OidTsTzRangeArray, OidTsVector, OidTsVectorArray, OidUuid, OidUuidArray, OidVarbit, OidVarbitArray, OidVarchar, OidVarcharArray, OidXml, OidXmlArray, PgArray, PgArrayMaxDim, PgBit, PgBitMaxBits, PgBox, PgCidr, PgCircle, PgConfigError, PgConnectionError, PgError, PgHstore, PgInet, PgInlineBufSize, PgInterval, PgLine, PgListenError, PgListenStoppedError, PgLseg, PgMacAddr, PgMacAddr8, PgMessageTooLargeError, PgMoney, PgMoneyConventions, PgMultirange, PgNoRowsError, PgNotifyOverflowError, PgNullError, PgNumeric, PgNumericSign, PgParam, PgParamInline, PgPath, PgPoint, PgPolygon, PgPoolError, PgProtocolError, PgQueryError, PgRange, PgRangeBound, PgSecurityError, PgStateError, PgTime, PgTimeoutError, PgTimeTz, PgTsQuery, PgTsVector, PgTypeError, PgUnavailableError, PgUuid, PgXml, PoolErrorKind, ProtocolError, RelOff, ResultFormat, RetryAdvice, SqlStateAdminShutdown, SqlStateCannotConnectNow, SqlStateCheckViolation, SqlStateConfigurationLimitExceeded, SqlStateCrashShutdown, SqlStateDeadlockDetected, SqlStateDuplicateObject, SqlStateExclusionViolation, SqlStateForeignKeyViolation, SqlStateIdleInTransactionSessionTimeout, SqlStateIdleSessionTimeout, SqlStateInFailedSqlTransaction, SqlStateInsufficientPrivilege, SqlStateInvalidCatalogName, SqlStateInvalidPassword, SqlStateLockNotAvailable, SqlStateNotNullViolation, SqlStateObjectInUse, SqlStateProtocolViolation, SqlStateQueryCanceled, SqlStateSerializationFailure, SqlStateSyntaxError, SqlStateTransactionTimeout, SqlStateUndefinedTable, SqlStateUniqueViolation, [], [], accountingParens, addBindDirect, addParseDirect, affectedRows, amount, appendBytes, checkMoneyScale, checkPgMoneyConventions, cmp, coerceBinaryParam, columnIndex, columnIndex, columnMap, columnName, constraintName, contains, data, dataTypeName, decimalSep, decodeFloat32BE, decodeFloat64BE, emptyRange, encodeBinaryArray, encodeBinaryArray, encodeBinaryComposite, encodeCompositeText, encodeEnumTextArray, encodeHstoreText, errorField, expectedElemCount, foldBindParam, foldBindParam, formatPgMoney, formatPgMoney, fracDigits, fromBE16, fromBE32, fromBE64, fromPgText, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, getArrayND, getArrayNDOpt, getBit, getBit, getBitArray, getBitArray, getBitArrayOpt, getBitArrayOpt, getBitOpt, getBitOpt, getBool, getBool, getBoolArray, getBoolArray, getBoolArrayElemOpt, getBoolArrayElemOpt, getBoolArrayElemOptOpt, getBoolArrayElemOptOpt, getBoolArrayOpt, getBoolArrayOpt, getBoolOpt, getBoolOpt, getBox, getBox, getBoxArray, getBoxArray, getBoxArrayOpt, getBoxArrayOpt, getBoxOpt, getBoxOpt, getBytes, getBytes, getBytesArray, getBytesArray, getBytesArrayOpt, getBytesArrayOpt, getBytesOpt, getBytesOpt, getCidr, getCidr, getCidrArray, getCidrArray, getCidrArrayOpt, getCidrArrayOpt, getCidrOpt, getCidrOpt, getCircle, getCircle, getCircleArray, getCircleArray, getCircleArrayOpt, getCircleArrayOpt, getCircleOpt, getCircleOpt, getComposite, getCompositeOpt, getDate, getDate, getDateArray, getDateArray, getDateArrayOpt, getDateArrayOpt, getDateMultirange, getDateMultirange, getDateMultirangeArray, getDateMultirangeArray, getDateMultirangeArrayOpt, getDateMultirangeArrayOpt, getDateMultirangeOpt, getDateMultirangeOpt, getDateOpt, getDateOpt, getDateRange, getDateRange, getDateRangeArray, getDateRangeArray, getDateRangeArrayOpt, getDateRangeArrayOpt, getDateRangeOpt, getDateRangeOpt, getDomain, getDomainOpt, getEnum, getEnumArray, getEnumArrayElemOpt, getEnumArrayOpt, getEnumOpt, getErrorField, getFloat, getFloat, getFloat32, getFloat32, getFloat32Array, getFloat32Array, getFloat32ArrayElemOpt, getFloat32ArrayElemOpt, getFloat32ArrayElemOptOpt, getFloat32ArrayElemOptOpt, getFloat32ArrayOpt, getFloat32ArrayOpt, getFloat32Opt, getFloat32Opt, getFloatArray, getFloatArray, getFloatArrayElemOpt, getFloatArrayElemOpt, getFloatArrayElemOptOpt, getFloatArrayElemOptOpt, getFloatArrayOpt, getFloatArrayOpt, getFloatOpt, getFloatOpt, getHstore, getHstore, getHstoreArray, getHstoreArray, getHstoreArrayOpt, getHstoreArrayOpt, getHstoreOpt, getHstoreOpt, getInet, getInet, getInetArray, getInetArray, getInetArrayOpt, getInetArrayOpt, getInetOpt, getInetOpt, getInt, getInt, getInt16, getInt16, getInt16Array, getInt16Array, getInt16ArrayElemOpt, getInt16ArrayElemOpt, getInt16ArrayElemOptOpt, getInt16ArrayElemOptOpt, getInt16ArrayOpt, getInt16ArrayOpt, getInt16Opt, getInt16Opt, getInt4Multirange, getInt4Multirange, getInt4MultirangeArray, getInt4MultirangeArray, getInt4MultirangeArrayOpt, getInt4MultirangeArrayOpt, getInt4MultirangeOpt, getInt4MultirangeOpt, getInt4Range, getInt4Range, getInt4RangeArray, getInt4RangeArray, getInt4RangeArrayOpt, getInt4RangeArrayOpt, getInt4RangeOpt, getInt4RangeOpt, getInt64, getInt64, getInt64Array, getInt64Array, getInt64ArrayElemOpt, getInt64ArrayElemOpt, getInt64ArrayElemOptOpt, getInt64ArrayElemOptOpt, getInt64ArrayOpt, getInt64ArrayOpt, getInt64Opt, getInt64Opt, getInt8Multirange, getInt8Multirange, getInt8MultirangeArray, getInt8MultirangeArray, getInt8MultirangeArrayOpt, getInt8MultirangeArrayOpt, getInt8MultirangeOpt, getInt8MultirangeOpt, getInt8Range, getInt8Range, getInt8RangeArray, getInt8RangeArray, getInt8RangeArrayOpt, getInt8RangeArrayOpt, getInt8RangeOpt, getInt8RangeOpt, getIntArray, getIntArray, getIntArrayElemOpt, getIntArrayElemOpt, getIntArrayElemOptOpt, getIntArrayElemOptOpt, getIntArrayOpt, getIntArrayOpt, getInterval, getInterval, getIntervalArray, getIntervalArray, getIntervalArrayOpt, getIntervalArrayOpt, getIntervalOpt, getIntervalOpt, getIntOpt, getIntOpt, getJson, getJson, getJsonArray, getJsonArray, getJsonArrayOpt, getJsonArrayOpt, getJsonOpt, getJsonOpt, getLine, getLine, getLineArray, getLineArray, getLineArrayOpt, getLineArrayOpt, getLineOpt, getLineOpt, getLseg, getLseg, getLsegArray, getLsegArray, getLsegArrayOpt, getLsegArrayOpt, getLsegOpt, getLsegOpt, getMacAddr, getMacAddr, getMacAddr8, getMacAddr8, getMacAddr8Array, getMacAddr8Array, getMacAddr8ArrayOpt, getMacAddr8ArrayOpt, getMacAddr8Opt, getMacAddr8Opt, getMacAddrArray, getMacAddrArray, getMacAddrArrayOpt, getMacAddrArrayOpt, getMacAddrOpt, getMacAddrOpt, getMoney, getMoney, getMoney, getMoney, getMoneyArray, getMoneyArray, getMoneyArray, getMoneyArray, getMoneyArrayND, getMoneyArrayND, getMoneyArrayND, getMoneyArrayND, getMoneyArrayNDOpt, getMoneyArrayNDOpt, getMoneyArrayNDOpt, getMoneyArrayNDOpt, getMoneyArrayOpt, getMoneyArrayOpt, getMoneyArrayOpt, getMoneyArrayOpt, getMoneyOpt, getMoneyOpt, getMoneyOpt, getMoneyOpt, getNumeric, getNumeric, getNumericArray, getNumericArray, getNumericArrayOpt, getNumericArrayOpt, getNumericOpt, getNumericOpt, getNumMultirange, getNumMultirange, getNumMultirangeArray, getNumMultirangeArray, getNumMultirangeArrayOpt, getNumMultirangeArrayOpt, getNumMultirangeOpt, getNumMultirangeOpt, getNumRange, getNumRange, getNumRangeArray, getNumRangeArray, getNumRangeArrayOpt, getNumRangeArrayOpt, getNumRangeOpt, getNumRangeOpt, getPath, getPath, getPathArray, getPathArray, getPathArrayOpt, getPathArrayOpt, getPathOpt, getPathOpt, getPoint, getPoint, getPointArray, getPointArray, getPointArrayOpt, getPointArrayOpt, getPointOpt, getPointOpt, getPolygon, getPolygon, getPolygonArray, getPolygonArray, getPolygonArrayOpt, getPolygonArrayOpt, getPolygonOpt, getPolygonOpt, getStr, getStr, getStrArray, getStrArray, getStrArrayElemOpt, getStrArrayElemOpt, getStrArrayElemOptOpt, getStrArrayElemOptOpt, getStrArrayOpt, getStrArrayOpt, getStrOpt, getStrOpt, getTime, getTime, getTimeArray, getTimeArray, getTimeArrayOpt, getTimeArrayOpt, getTimeOpt, getTimeOpt, getTimestamp, getTimestamp, getTimestampArray, getTimestampArray, getTimestampArrayOpt, getTimestampArrayOpt, getTimestampOpt, getTimestampOpt, getTimestampTz, getTimestampTz, getTimestampTzArray, getTimestampTzArray, getTimestampTzArrayOpt, getTimestampTzArrayOpt, getTimestampTzOpt, getTimestampTzOpt, getTimeTz, getTimeTz, getTimeTzArray, getTimeTzArray, getTimeTzArrayOpt, getTimeTzArrayOpt, getTimeTzOpt, getTimeTzOpt, getTsMultirange, getTsMultirange, getTsMultirangeArray, getTsMultirangeArray, getTsMultirangeArrayOpt, getTsMultirangeArrayOpt, getTsMultirangeOpt, getTsMultirangeOpt, getTsQuery, getTsQuery, getTsQueryArray, getTsQueryArray, getTsQueryArrayOpt, getTsQueryArrayOpt, getTsQueryOpt, getTsQueryOpt, getTsRange, getTsRange, getTsRangeArray, getTsRangeArray, getTsRangeArrayOpt, getTsRangeArrayOpt, getTsRangeOpt, getTsRangeOpt, getTsTzMultirange, getTsTzMultirange, getTsTzMultirangeArray, getTsTzMultirangeArray, getTsTzMultirangeArrayOpt, getTsTzMultirangeArrayOpt, getTsTzMultirangeOpt, getTsTzMultirangeOpt, getTsTzRange, getTsTzRange, getTsTzRangeArray, getTsTzRangeArray, getTsTzRangeArrayOpt, getTsTzRangeArrayOpt, getTsTzRangeOpt, getTsTzRangeOpt, getTsVector, getTsVector, getTsVectorArray, getTsVectorArray, getTsVectorArrayOpt, getTsVectorArrayOpt, getTsVectorOpt, getTsVectorOpt, getUuid, getUuid, getUuidArray, getUuidArray, getUuidArrayOpt, getUuidArrayOpt, getUuidOpt, getUuidOpt, getXml, getXml, getXmlArray, getXmlArray, getXmlArrayOpt, getXmlArrayOpt, getXmlOpt, getXmlOpt, groupDigits, hash, hash, hash, inferPgMoneyConventions, initCommandResult, initPgBit, initPgMoney, initPgMoneyConventions, internalPosition, internalQuery, isBinaryCol, isCheckViolation, isDeadlockDetected, isDuplicateObject, isEmpty, isExclusionViolation, isFinite, isForeignKeyViolation, isIntegrityConstraintViolation, isLastingRefusal, isNotNullViolation, isNull, isNull, isQueryCanceled, isSerializationFailure, isSessionFatal, isTransientError, isUniqueViolation, isZero, items, len, len, nbits, ndim, newPoolError, paramOidOf, paramOidOf, paramOidOf, paramOidOf, paramOidOf, paramOidOf, paramOidOf, paramOidOf, paramOidOf, paramOidOf, parseBitString, parseCompositeText, parseDateText, parseHstoreText, parseInetText, parseIntervalText, parseMultirangeText, parsePgMoney, parsePgMoney, parsePgNumeric, parsePointsText, parsePointText, parseRangeText, parseTextArray, parseTimestampText, parseTimeText, parseTimeTzText, pgArray, pgArray, pgArray, pgArray, pgArray, pgColumn, pgComposite, pgDomain, pgEnum, pgEnum, pgEnum, pgEpochDaysOffset, pgEpochUnix, pgParams, pgSkip, pgTzDispLimit, position, rangeContainEmpty, rangeEmpty, rangeFrom, rangeLbInc, rangeLbInf, rangeOf, rangeTo, rangeUbInc, rangeUbInf, readBytes, readString, retryAdvice, scale, schemaName, sepBySpace, serverErrors, symbol, symbolBefore, tableName, thousandsSep, to, toBE16, toBE32, toBE64, toBytes, toMultirange, toPgBinaryDateMultirangeArrayParam, toPgBinaryDateMultirangeParam, toPgBinaryDateParam, toPgBinaryDateRangeArrayParam, toPgBinaryDateRangeParam, toPgBinaryParam, toPgBinaryParam, toPgBinaryParam, toPgBinaryParam, toPgBinaryParam, toPgBinaryParam, toPgBinaryParam, toPgBinaryParam, toPgBinaryParam, toPgBinaryParam, toPgBinaryParam, toPgBinaryParam, toPgBinaryParam, toPgBinaryParam, toPgBinaryParam, toPgBinaryParam, toPgBinaryParam, toPgBinaryParam, toPgBinaryParam, toPgBinaryParam, toPgBinaryParam, toPgBinaryParam, toPgBinaryParam, toPgBinaryParam, toPgBinaryParam, toPgBinaryParam, toPgBinaryParam, toPgBinaryParam, toPgBinaryParam, toPgBinaryParam, toPgBinaryParam, toPgBinaryParam, toPgBinaryParam, toPgBinaryParam, toPgBinaryParam, toPgBinaryParam, toPgBinaryParam, toPgBinaryParam, toPgBinaryParam, toPgBinaryParam, toPgBinaryParam, toPgBinaryParam, toPgBinaryParam, toPgBinaryParam, toPgBinaryParam, toPgBinaryParam, toPgBinaryParam, toPgBinaryParam, toPgBinaryParam, toPgBinaryParam, toPgBinaryParam, toPgBinaryParam, toPgBinaryParam, toPgBinaryParam, toPgBinaryParam, toPgBinaryParam, toPgBinaryParam, toPgBinaryParam, toPgBinaryTimestampTzParam, toPgBinaryTsTzMultirangeArrayParam, toPgBinaryTsTzMultirangeParam, toPgBinaryTsTzRangeArrayParam, toPgBinaryTsTzRangeParam, toPgByteaArrayParam, toPgDateArrayParam, toPgDateMultirangeArrayParam, toPgDateMultirangeParam, toPgDateParam, toPgDateRangeArrayParam, toPgDateRangeParam, toPgMoneyArrayNDParam, toPgMoneyArrayParam, toPgMultirangeParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParam, toPgParamInline, toPgParamInline, toPgParamInline, toPgParamInline, toPgParamInline, toPgParamInline, toPgParamInline, toPgParamInline, toPgParamInline, toPgParamInline, toPgParamInline, toPgParamInline, toPgParamInline, toPgRangeParam, toPgTimestampArrayParam, toPgTimestampTzArrayParam, toPgTimestampTzParam, toPgTsMultirangeArrayParam, toPgTsTzMultirangeArrayParam, toPgTsTzMultirangeParam, toPgTsTzRangeArrayParam, toPgTsTzRangeParam, toRow, toString, unboundedRange, validate, validatePgArrayShape, where, writeBE16, writeBE32, writeBE64, writeBindParam, writeBindParam, writeBytesAt, writeParamFormat, writeParamFormat, writeParamFormat, writeParamFormat, writeParamFormat, writeParamFormat, writeParamFormat, writeParamFormat, writeParamFormat, writeParamFormat, writeParamOid, writeParamOid, writeParamOid, writeParamOid, writeParamOid, writeParamOid, writeParamOid, writeParamOid, writeParamOid, writeParamOid, writeParamValue, writeParamValue, writeParamValue, writeParamValue, writeParamValue, writeParamValue, writeParamValue, writeParamValue, writeParamValue, writeParamValue, AuthMethod, CachedStmt, ChannelBindingMode, CleanupKind, CleanupSkipReason, ClientCertPairingErrorMsg, ConnConfig, ConnCredentials, CopyInCallback, CopyInInfo, CopyOutCallback, CopyOutInfo, CopyResult, CredentialsProvider, CredentialsRequest, ErrorField, HostEntry, ListenErrorCallback, LoadBalanceHosts, Notice, NoticeCallback, Notification, NotifyCallback, NotifyOverflowCallback, PgConfigError, PgConnection, PgConnectionError, PgConnState, PgError, PgListenError, PgListenStoppedError, PgMessageTooLargeError, PgNoRowsError, PgNotifyOverflowError, PgNullError, PgPoolError, PgPoolOwner, PgProtocolError, PgQueryError, PgSecurityError, PgStateError, PgTimeoutError, PgTracer, PgTypeError, PgUnavailableError, PoolErrorKind, ProtocolError, QueryResult, ReconnectCallback, RetryAdvice, RowCallback, SqlStateAdminShutdown, SqlStateCannotConnectNow, SqlStateCheckViolation, SqlStateConfigurationLimitExceeded, SqlStateCrashShutdown, SqlStateDeadlockDetected, SqlStateDuplicateObject, SqlStateExclusionViolation, SqlStateForeignKeyViolation, SqlStateIdleInTransactionSessionTimeout, SqlStateIdleSessionTimeout, SqlStateInFailedSqlTransaction, SqlStateInsufficientPrivilege, SqlStateInvalidCatalogName, SqlStateInvalidPassword, SqlStateLockNotAvailable, SqlStateNotNullViolation, SqlStateObjectInUse, SqlStateProtocolViolation, SqlStateQueryCanceled, SqlStateSerializationFailure, SqlStateSyntaxError, SqlStateTransactionTimeout, SqlStateUndefinedTable, SqlStateUniqueViolation, SslMode, SslNegotiation, TargetSessionAttrs, TraceAdvisoryUnlockFailedData, TraceCleanupSkippedData, TraceConnectEndData, TraceConnectStartData, TraceContext, TraceCopyDirection, TraceCopyEndData, TraceCopyStartData, TraceDeprecatedAuthData, TraceInsecureAuthData, TraceLeakedSessionLocksData, TracePipelineEndData, TracePipelineStartData, TracePoolAcquireEndData, TracePoolAcquireStartData, TracePoolCloseErrorData, TracePoolDoubleReleaseData, TracePoolReleaseEndData, TracePoolReleaseStartData, TracePrepareEndData, TracePrepareStartData, TraceQueryEndData, TraceQueryStartData, TraceTransportCloseErrorData, TransportCloseStage, TypeOidInfo, cancel, cancelNoWait, checkSessionAttrs, close, columnIndex, columnName, config, connect, connect, connectToHost, constraintName, createdAt, dataTypeName, dialAddr, displayHost, errorField, getErrorField, getHosts, host, initConnConfig, internalPosition, internalQuery, invalidateOnTimeout, isCheckViolation, isConnected, isDeadlockDetected, isDuplicateObject, isExclusionViolation, isForeignKeyViolation, isIntegrityConstraintViolation, isLastingRefusal, isNotNullViolation, isQueryCanceled, isSerializationFailure, isSessionFatal, isTransientError, isUniqueViolation, isUnixSocket, items, len, listen, listenError, listenReconnectMaxAttempts, listenReconnectMaxAttempts=, listenReconnectMaxBackoff, listenReconnectMaxBackoff=, lookupTypeOids, makeCopyInCallback, makeCopyOutCallback, makeCredentialsProvider, newPoolError, notifyDropped, notifyMaxQueue, notifyMaxQueue=, notifyMaxQueueBytes, notifyMaxQueueBytes=, onListenError, onNotice, onNotify, onNotifyOverflow, onReconnect, orderedHosts, parseDsn, pid, ping, port, position, quoteIdentifier, quoteLiteral, retryAdvice, rows, schemaName, serverErrors, serverParam, serverParams, simpleExec, simpleQuery, socketHasFin, socketHasPendingData, sslEnabled, state, stmtCacheCapacity, stmtCacheCapacity=, stopListening, tableName, to, txStatus, unixSocketPath, unlisten, validateConnConfig, waitNotification, where, withConnTracing, withTracing, AccessMode, CopyInRowsCallback, Cursor, DeferrableMode, IsolatedPipelineResults, IsolationLevel, Pipeline, PipelineResult, PipelineResultKind, PreparedStatement, RetryOptions, TransactionOptions, addExec, addExec, addQuery, addQuery, backoffDelayMs, buildBeginSql, close, close, columnIndex, columnIndex, conn, conn, copyIn, copyIn, copyIn, copyIn, copyInRows, copyInRowsStream, copyInStream, copyOut, copyOutStream, exec, exec, execDirect, execInTransaction, execInTransaction, execute, execute, executeIsolated, exhausted, fetchNext, fields, fields, isRetryableTxError, makeCopyInRowsCallback, name, newPipeline, notify, openCursor, paramOids, prepare, query, query, queryColumn, queryDirect, queryEach, queryExists, queryInTransaction, queryInTransaction, queryRow, queryRowOpt, queryValue, queryValue, queryValueOpt, queryValueOpt, queryValueOrDefault, queryValueOrDefault, queryValueOrDefault, reset, sql, withCursor, withSavepoint, withSavepointDeadline, withTransaction, withTransactionDeadline, withTransactionRetry, withTransactionRetryDeadline, PgPoolCluster, ReadFallbackCallback, ReadFallbackReason, ReplicaFallback, close, fallbackTimeout, isClosed, newPoolCluster, onReadFallback, primaryPool, readConnection, replicaFallback, replicaPool, withPipeline, withReadConnection, withTransaction, withTransactionDeadline, withTransactionRetry, withTransactionRetryDeadline, withWriteConnection, writeConnection, INV_READ, INV_READWRITE, INV_WRITE, LargeObject, LoReadCallback, LoWriteCallback, Oid, SEEK_CUR, SEEK_END, SEEK_SET, conn, fd, loClose, loCreate, loDefaultChunkSize, loExport, loImport, loOpen, loRead, loReadAll, loReadAllDeadline, loReadStream, loReadStreamDeadline, loSeek, loSize, loSizeDeadline, loTell, loTruncate, loUnlink, loWrite, loWriteAll, loWriteAllDeadline, loWriteStream, loWriteStreamDeadline, makeLoReadCallback, makeLoWriteCallback, oid, withLargeObject, advisoryLock, advisoryLock, advisoryLockShared, advisoryLockShared, advisoryLockXact, advisoryLockXact, advisoryLockXactShared, advisoryLockXactShared, advisoryTryLock, advisoryTryLock, advisoryTryLockShared, advisoryTryLockShared, advisoryTryLockXact, advisoryTryLockXact, advisoryTryLockXactShared, advisoryTryLockXactShared, advisoryUnlock, advisoryUnlock, advisoryUnlockAll, advisoryUnlockShared, advisoryUnlockShared, withAdvisoryLock, withAdvisoryLockShared, withAdvisoryLockXact, withAdvisoryLockXactShared, SqlQuery, addExec, addQuery, exec, exec, execInTransaction, execInTransaction, execInTransaction, query, query, queryColumn, queryColumn, queryEach, queryEach, queryExists, queryExists, queryInTransaction, queryInTransaction, queryInTransaction, queryRow, queryRow, queryRowOpt, queryRowOpt, queryValue, queryValue, queryValue, queryValue, queryValueOpt, queryValueOpt, queryValueOpt, queryValueOpt, queryValueOrDefault, queryValueOrDefault, queryValueOrDefault, queryValueOrDefault, queryValueOrDefault, queryValueOrDefault, sql, sqlParams, $, <, <=, ==, BeginMessage, CommitMessage, DeleteMessage, InsertMessage, InvalidLsn, LogicalMessage, Lsn, OriginMessage, PgOutputMessage, PgOutputMessageKind, PrimaryKeepalive, RelationCache, RelationColumn, RelationInfo, ReplicationCallback, ReplicationMessage, ReplicationMessageKind, ReplicationMode, ReplicationSlotInfo, SystemInfo, TimelineHistory, TruncateMessage, TupleDataKind, TupleField, TypeMessage, UpdateMessage, XLogData, confirmedFlushLsn, confirmFlushed, connectReplication, connectReplication, createReplicationSlot, currentPgTimestamp, decodePgOutput, dropReplicationSlot, hasOldTuple, identifySystem, makeReplicationCallback, parseLsn, parsePgOutputMessage, parseReplicationMessage, parseTimelineId, readReplicationSlot, receivedEndLsn, sendCopyData, sendStandbyStatus, startPhysicalReplication, startReplication, stopReplication, timelineHistory, toInt64, toString, toUInt64, PoolConfig, DefaultResetQuery, PoolMetrics, PooledConnHandle, PgPool, AfterConnectHook, makeAfterConnectHook, initPoolConfig, poolConfig, idleCount, activeCount, size, pendingAcquires, isClosed, metrics, connectRefusal, resetSession, newPool, release, release, resetSessionAndRelease, acquire, acquireHandle, runAndRelease, withConnection, exec, exec, query, query, queryEach, queryRow, queryRowOpt, queryValue, queryValue, queryValueOpt, queryValueOpt, queryValueOrDefault, queryValueOrDefault, queryValueOrDefault, queryExists, queryColumn, simpleQuery, simpleExec, execInTransaction, execInTransaction, queryInTransaction, queryInTransaction, notify, withTransaction, withTransactionRetry, withTransactionDeadline, withTransactionRetryDeadline, withPipeline, close, $, +, +, -, -, -, <, <, <=, <=, ==, AsyncTimeoutError, CancelledError, Duration, InfiniteDuration, Moment, ZeroDuration, allFutures, allFuturesCancelling, asyncSpawn, cancelAndWait, cancelAndWaitPumped, cancelTimer, completed, deadlineAfter, declareAsyncCallback, hasAsyncDispatch, hasChronos, hasTls, hours, isUnbounded, makeAsyncSeqByteCallback, makeAsyncSinkByteCallback, milliseconds, minutes, nanoseconds, nanoseconds, noCancel, normalizeTimeout, now, registerFdReader, remainingDeadlineDuration, scheduleSoon, seconds, sleepAsync, sleepMsAsync, toMilliseconds, unregisterFdReader, wait, FrontendMessageKind, BackendMessageKind, DescribeKind, TransactionStatus, FieldDescription, CopyFormat, BackendMessage, ParseState, ParseResult, RowData, Row, syncMsg, flushMsg, copyDoneMsg, BinarySafeOids, maxInt16Count, maxInt32Len, DefaultMaxBackendMessageLen, MaxNegotiateProtocolOptions, MaxErrorOrNoticeFields, MaxSaslMechanisms, MaxServerParams, MaxServerParamsBytes, initRow, data, rowIdx, isBinarySafeOid, addInt16, addInt32, addCount16, addLen32, addCString, patchMsgLen, patchMsgLenAtomic, preflightParseDirect, preflightBindDirect, encodeStartup, encodeSSLRequest, encodePassword, encodeSASLInitialResponse, encodeSASLResponse, encodeQuery, addParse, addBind, addBindRaw, addDescribe, addExecute, addClose, addSync, addFlush, addCopyDone, encodeParse, encodeBind, encodeDescribe, encodeExecute, encodeClose, encodeSync, encodeFlush, encodeTerminate, encodeCancelRequest, encodeCopyData, encodeCopyDone, encodeCopyFail, newRowData, reuseRowData, reuseRowData, clone, buildResultFormats, parseDataRowInto, parseBackendMessage, formatError, addCopyBinaryHeader, addCopyBinaryTrailer, addCopyTupleStart, addCopyFieldNull, addCopyFieldInt16, addCopyFieldInt32, addCopyFieldInt64, addCopyFieldFloat64, addCopyFieldFloat32, addCopyFieldBool, addCopyFieldText, addCopyFieldString, encodeStandbyStatusUpdate