enum PG::Backend
The messages a server sends, decoded.
Variants
variant PG::Backend::AuthenticationOk
Authentication succeeded.
variant PG::Backend::AuthenticationCleartextPassword
The server asks for the password in clear.
variant PG::Backend::AuthenticationMD5Password(salt: Bytes)
The server asks for the password hashed with MD5 and this salt.
variant PG::Backend::AuthenticationSASL(mechanisms: Array[String])
The server asks for SASL with one of these mechanisms.
variant PG::Backend::AuthenticationSASLContinue(data: Bytes)
A SASL challenge: the mechanism's data.
variant PG::Backend::AuthenticationSASLFinal(data: Bytes)
The SASL outcome: the mechanism's last data.
variant PG::Backend::AuthenticationOther(code: Int)
A method this client does not speak (Kerberos, GSSAPI, SSPI): its code.
variant PG::Backend::ParameterStatus(name: String, value: String)
A run-time parameter and its value, at startup and when it changes.
variant PG::Backend::BackendKeyData(process_id: Int, secret: Bytes)
The key a cancel request names: 4 bytes before protocol 3.2, up to 256 after.
variant PG::Backend::ReadyForQuery(status: String)
I idle, T in a transaction, E in a failed transaction.
variant PG::Backend::RowDescription(fields: Array[PG::Field])
The columns of the rows that follow.
variant PG::Backend::DataRow(values: Array[Bytes?])
Each column's value, nil for NULL.
variant PG::Backend::CommandComplete(tag: String)
A statement finished: its command tag (INSERT 0 1, SELECT 2).
variant PG::Backend::EmptyQueryResponse
The query was empty.
variant PG::Backend::ErrorResponse(fields: Hash[String, String])
The fields by their one-letter codes (S severity, C SQLSTATE,
M message, D detail, H hint, P position, ...).
variant PG::Backend::NoticeResponse(fields: Hash[String, String])
A notice or warning, with the fields an error has.
variant PG::Backend::ParseComplete
A Parse succeeded.
variant PG::Backend::BindComplete
A Bind succeeded.
variant PG::Backend::CloseComplete
A Close succeeded.
variant PG::Backend::NoData
The statement or portal described returns no rows.
variant PG::Backend::PortalSuspended
Execute stopped at its row limit; the portal has more.
variant PG::Backend::ParameterDescription(types: Array[Int])
A prepared statement's parameter types (OIDs).
variant PG::Backend::NotificationResponse(process_id: Int, channel: String, payload: String)
A NOTIFY on a channel this session listens to.
variant PG::Backend::NegotiateProtocolVersion(minor: Int, options: Array[String])
The newest minor version the server speaks, and the startup options it did not recognize.
Class methods
def self.decode(type: Int, body: Bytes) -> PG::Backend
The message of type type (its byte) with the body body. Raises
PG::ProtocolError for a type this client does not know (COPY's
among them, for now) or a body that does not parse.
PG::Backend.decode('Z'.ord, b"I") # => PG::Backend::ReadyForQuery(status: "I")