↑↓ select↵ open⌫ change scopeOpen full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

Wiki / Protocol Messages

TupleData (logical replication)

Logical replication TupleData format. Number of columns.

Reading PG 18·Select a recorded version

Layer
Logical replication payload; distinct from the frontend/backend message envelope
First field
Int16
manual path
/docs/18/protocol-logicalrep-message-formats.html
signature
TupleData

Definition PG 18

Int16

Number of columns.

Next, one of the following submessages appears for each published column:

Byte1('n')

Identifies the data as NULL value.

Or

Byte1('u')

Identifies unchanged TOASTed value (the actual value is not sent).

Or

Byte1('t')

Identifies the data as text formatted value.

Or

Byte1('b')

Identifies the data as binary formatted value.

Int32

Length of the column value.

Byten

The value of the column, either in binary or in text format. (As specified in the preceding format byte). n is the above length.

Fields in documented order

PositionFormatMeaning
1Int16Number of columns.
2Byte1('n')Identifies the data as NULL value.
3Byte1('u')Identifies unchanged TOASTed value (the actual value is not sent).
4Byte1('t')Identifies the data as text formatted value.
5Byte1('b')Identifies the data as binary formatted value.
6Int32Length of the column value.
7Byte nThe value of the column, either in binary or in text format. (As specified in the preceding format byte). n is the above length.

Compare versions

Complete source facts

fields

map[description:Number of columns. format:Int16], map[description:Identifies the data as NULL value. format:Byte1('n')], map[description:Identifies unchanged TOASTed value (the actual value is not sent). format:Byte1('u')], map[description:Identifies the data as text formatted value. format:Byte1('t')], map[description:Identifies the data as binary formatted value. format:Byte1('b')], map[description:Length of the column value. format:Int32], map[description:The value of the column, either in binary or in text format. (As specified in the preceding format byte). n is the above length. format:Byte n]

Source references

Full definition and evidence JSON

Definition sources

center · PostgreSQL 18 · 555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f

Text language: en · 555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f