Skip to main content

Module ids

Module ids 

Source
Expand description

Domain newtypes for the Postgres logical-decoding connector.

Logical decoding threads several primitives of the same type, and a call site can transpose them easily. The pgoutput Commit message carries two adjacent PgLsn values, commit_lsn and end_lsn. Transaction ids and commit timestamps are both i64, and they sit next to each other on a row. relation_id is a bare u32 that the relation cache and every row event share. A distinct newtype around each one turns a swapped argument into a compile error, instead of silent offset or transaction corruption. See the newtype guidance in the style guide.

Structsยง

CommitLsn
LSN at which a transaction was committed. This is the pgoutput Commit.commit_lsn.
EndLsn
End-of-transaction LSN, the resume point after a commit. This is the pgoutput Commit.end_lsn.
RelationId
pgoutput relation identifier. It keys the relation cache and every row event.
TransactionId
Postgres transaction id (xid) carried by begin/commit and stamped onto each decoded row.