Skip to main content

Module decoder

Module decoder 

Source
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§

BeginMessage
Transaction begin message.
CommitMessage
Transaction commit message.
DeleteMessage
Row delete message.
InsertMessage
Row insert message.
OriginMessage
Origin message (for replication from a downstream).
RelationMessage
Relation (table schema) message.
TruncateMessage
Table truncate message.
TupleData
Tuple data containing column values.
TypeMessage
Custom type definition message.
UpdateMessage
Row update message.

Enums§

ColumnValue
A single column value in a tuple.
DecoderError
Errors from the pgoutput protocol decoder.
WalMessage
A decoded WAL message from the pgoutput protocol.

Functions§

decode_message
Decodes a single pgoutput WAL message from raw bytes.
pg_timestamp_to_unix_ms
Converts a PostgreSQL timestamp (microseconds since 2000-01-01) to milliseconds since Unix epoch (1970-01-01).