Expand description
PostgreSQL pgoutput logical replication protocol decoder.
Implements a binary protocol parser for the pgoutput output plugin
used by PostgreSQL logical replication (PG 10+). Parses WAL stream
bytes into structured WalMessage variants.
§Protocol Reference
See PostgreSQL docs: “Logical Replication Message Formats”
(https://www.postgresql.org/docs/current/protocol-logicalrep-message-formats.html)
Structs§
- Begin
Message - Transaction begin message.
- Commit
Message - Transaction commit message.
- Delete
Message - Row delete message.
- Insert
Message - Row insert message.
- Origin
Message - Origin message (for replication from a downstream).
- Relation
Message - Relation (table schema) message.
- Truncate
Message - Table truncate message.
- Tuple
Data - Tuple data containing column values.
- Type
Message - Custom type definition message.
- Update
Message - Row update message.
Enums§
- Column
Value - A single column value in a tuple.
- Decoder
Error - Errors from the
pgoutputprotocol decoder. - WalMessage
- A decoded WAL message from the
pgoutputprotocol.
Functions§
- decode_
message - Decodes a single
pgoutputWAL message from raw bytes. - pg_
timestamp_ to_ unix_ ms - Converts a
PostgreSQLtimestamp (microseconds since 2000-01-01) to milliseconds since Unix epoch (1970-01-01).