Skip to main content

Module pgoutput

Module pgoutput 

Source
Expand description

A pure decoder for the pgoutput logical-replication protocol, version 1 (the binary messages pg_logical_slot_peek_binary_changes returns with proto_version '1'), and Stream, which groups the decoded changes by source transaction.

Integers are big-endian; strings are NUL-terminated and assumed UTF-8 (a UTF8 server encoding); tuple values arrive in text form.

Structs§

Column
A column of a Relation message.
Relation
A Relation message: the shape of the tuples of relation id.
Stream
Groups a sequence of messages (one decoding session) into committed transactions. A transaction still open at the end is not in done.
Txn
A committed source transaction: its row changes (Insert, Update, Delete and Truncate messages, in order) and its commit’s end LSN.

Enums§

Datum
One column value of a tuple.
DecodeError
A malformed or unexpected pgoutput message.
Message
A decoded pgoutput message.

Functions§

decode
Decode one pgoutput (protocol 1) message.
format_lsn
An LSN in Postgres’ X/Y text form.
parse_lsn
Parse an LSN from Postgres’ X/Y text form.

Type Aliases§

Result
A decode result.
Tuple
A row: one Datum per column of its Relation.