Expand description
PostgreSQL wire protocol implementation.
PostgreSQL uses a simple message format with a type byte and length prefix. This module provides encoding/decoding for all frontend and backend messages.
§Message Format
§Standard Message (after startup)
+------+--------+------------------+
| Type | Length | Payload |
| 1B | 4B | (Length-4) bytes |
+------+--------+------------------+Length includes itself (4 bytes) but not the type byte.
§Startup Message (first message from client)
+--------+------------------+
| Length | Payload |
| 4B | (Length-4) bytes |
+--------+------------------+No type byte for startup message.
Modules§
- auth_
type - Authentication method codes from the server.
- backend_
type - Message type bytes for backend messages.
- frontend_
type - Message type bytes for frontend messages.
Structs§
- Error
Fields - Error and notice response fields.
- Field
Description - Describes a single field (column) in a row description.
- Message
Reader - Incremental reader for PostgreSQL backend messages.
- Message
Writer - Buffer for writing PostgreSQL protocol messages.
Enums§
- Backend
Message - Messages sent from the PostgreSQL server to the client.
- Describe
Kind - Kind for Describe/Close messages
- Frontend
Message - Messages sent from the client to the PostgreSQL server.
- Transaction
Status - Transaction status indicator from ReadyForQuery
Constants§
- CANCEL_
REQUEST_ CODE - Cancel request code.
- PROTOCOL_
VERSION - Protocol version 3.0.
- SSL_
REQUEST_ CODE - SSL request code.