Postgres module

Connection

structsince 0.27.0Source

Fields

backend_pid: s32
server_version: s64
From server_version: 170011 for 17.11, 150004 for 15.4.
parameters: [..] Parameter
What the server reported with ParameterStatus: server_version, TimeZone, client_encoding, standard_conforming_strings, ... (parameter(connection, name) looks one up).
on_notice: Notice_Proc
user_data: *void
for the program: on_notice can find its state here
on_notification: Notification_Proc
notifications: [..] Notification
Notifications received and not yet taken, oldest first, when on_notification is not set.
on_trace: Trace_Proc
set_trace
trace_data: *void
protocol_minor: u32
The minor protocol version in use: 2 (PostgreSQL 18 and later) or 0.
protocol_requested: u32
the minor version the startup message asked for
protocol_required: u32
the lowest minor version min_protocol_version accepts
tls_used: bool
channel_binding_used: bool
Authentication used SCRAM-SHA-256-PLUS: the password exchange is bound to this TLS session.
broken: bool
Set when the connection can no longer be used: a failed read or write, a protocol error, or a FATAL error from the server.
busy: bool
a request is in flight
pool: *Pool
the pool it belongs to, if any
host: string
Below: the client's own state.
tls_name: string
The name the server's certificate is for (the host, not the address connected to), the name sent as SNI ("" for none), whether verify-full checks the name, and whether the handshake sent a client certificate.
tls_sni: string
key_log_file: string
sslkeylogfile, for the handshake.
tls_check_name: bool
tls_cert_sent: bool
port: u16
unix_socket: bool
ssl_direct: bool
cancel_timeout: s64
opened_at: s64
monotonic ms, for a pool's max_lifetime
cancel_key: [] u8
json_options: Json_Options
copied to each result
reader: Io.Reader
writer: Io.Writer
out: [..] u8
message_start: s64
message_type: u8
of the message being written; 0 for the startup messages
trace_regress: bool
pipeline: Pipeline
pipeline mode, when pipeline.active
statements: Statement_Cache
prepared statements, by query (statements.jai)
input: [..] u8
input_start: s64

See also