{"Entry":{"collection":"protocol","key":"logical-tupledata","name":"TupleData (logical replication)","aliases":["TupleData"],"metadata":{"aliases":["TupleData"],"category":"Logical replication formats","content_hash":"974a4fbeddbe6325bb651301632aae5ecdeefc6529083172d6acdaf5783a1e90","derived_content_hash":"0fddd7a77f620941125e4d021a9e7fea21366439a9da7b62471498846a5f8c9b","imported_at":"2026-09-30T00:40:44.669588+08:00","name":"TupleData (logical replication)","name_zh":"","slug":"logical-tupledata","summary":"Logical replication TupleData format. Number of columns."}},"Definition":{"Collection":"protocol","Key":"logical-tupledata","SourceDatabase":"center","Version":"18","SourceTable":"protocol_message","SourceKey":"logical-tupledata","SourceRevision":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","Facts":{"comparison_data":{"fields":[{"description":"Number of columns.","format":"Int16"},{"description":"Identifies the data as NULL value.","format":"Byte1('n')"},{"description":"Identifies unchanged TOASTed value (the actual value is not sent).","format":"Byte1('u')"},{"description":"Identifies the data as text formatted value.","format":"Byte1('t')"},{"description":"Identifies the data as binary formatted value.","format":"Byte1('b')"},{"description":"Length of the column value.","format":"Int32"},{"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"}],"layer":"logical replication"},"comparison_hash":"cd3ef259b145bd3bd43cb6212efe54d716871132f92df99b0cc8d685cc43c2fd","description":["Logical replication TupleData format. Number of columns."],"description_zh":"表示新元组内容的 TupleData 消息部分。","description_zh_html":"\u003cp\u003e协议消息 TupleData。\u003c/p\u003e\u003ch3\u003e同版本中文手册定义\u003c/h3\u003e\u003cdd\u003e\u003cp\u003e\n         表示新元组内容的 TupleData 消息部分。\n        \u003c/p\u003e\u003c/dd\u003e\u003cp\u003e\u003ca href=\"/zh/docs/18/protocol-logicalrep-message-formats.html#PROTOCOL-LOGICALREP-MESSAGE-FORMATS-TUPLEDATA\"\u003e查看完整中文手册与上下文\u003c/a\u003e。\u003c/p\u003e","facts":[{"label":"Layer","value":"Logical replication payload; distinct from the frontend/backend message envelope"},{"label":"First field","value":"Int16"}],"facts_zh":[{"label":"层次","value":"逻辑复制载荷，与前后端消息封装分开。"},{"label":"首个字段","value":"Int16"}],"fields":[{"description":"Number of columns.","format":"Int16"},{"description":"Identifies the data as NULL value.","format":"Byte1('n')"},{"description":"Identifies unchanged TOASTed value (the actual value is not sent).","format":"Byte1('u')"},{"description":"Identifies the data as text formatted value.","format":"Byte1('t')"},{"description":"Identifies the data as binary formatted value.","format":"Byte1('b')"},{"description":"Length of the column value.","format":"Int32"},{"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"}],"manual_html":"\u003cdl\u003e\u003cdd\u003e\n\u003cdiv class=\"variablelist\"\u003e\n\u003cdl class=\"variablelist\"\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003eInt16\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eNumber of columns.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003cp\u003eNext, one of the following submessages appears for each published column:\u003c/p\u003e\n\u003cdiv class=\"variablelist\"\u003e\n\u003cdl class=\"variablelist\"\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003eByte1('n')\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eIdentifies the data as NULL value.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003cp\u003eOr\u003c/p\u003e\n\u003cdiv class=\"variablelist\"\u003e\n\u003cdl class=\"variablelist\"\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003eByte1('u')\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eIdentifies unchanged TOASTed value (the actual value is not sent).\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003cp\u003eOr\u003c/p\u003e\n\u003cdiv class=\"variablelist\"\u003e\n\u003cdl class=\"variablelist\"\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003eByte1('t')\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eIdentifies the data as text formatted value.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003cp\u003eOr\u003c/p\u003e\n\u003cdiv class=\"variablelist\"\u003e\n\u003cdl class=\"variablelist\"\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003eByte1('b')\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eIdentifies the data as binary formatted value.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003eInt32\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eLength of the column value.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003eByte\u003cem class=\"replaceable\"\u003e\u003ccode\u003en\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eThe value of the column, either in binary or in text format. (As specified in the preceding format byte). \u003cem class=\"replaceable\"\u003e\u003ccode\u003en\u003c/code\u003e\u003c/em\u003e is the above length.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003c/dd\u003e\u003c/dl\u003e","manual_path":"/docs/18/protocol-logicalrep-message-formats.html","related":[{"label":"Streaming replication protocol","url":"/docs/18/protocol-replication.html"},{"label":"Logical Decoding Plugins","url":"/wiki/decode/?v=18"}],"release":{"channel":"stable","label":"18.6","major":"18","ref":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2","revision":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f"},"sections":[{"paragraphs":["This section describes the detailed format of each logical replication message. These messages are either returned by the replication slot SQL interface or are sent by a walsender. In the case of a walsender, they are encapsulated inside replication protocol WAL messages as described in Section 54.4 , and generally obey the same message flow as physical replication. The following messages (Stream Start, Stream Stop, Stream Commit, and Stream Abort) are available since protocol version 2. The following messages (Begin Prepare, Prepare, Commit Prepared, Rollback Prepared, Stream Prepare) are available since protocol version 3. The following message parts are shared by the above messages."],"title":"Protocol context"}],"sections_zh":[{"paragraphs":["本节说明各逻辑复制消息的详细格式。这些消息由复制槽 SQL 接口返回，或由 walsender 发送。由 walsender 发送时，它们被封装在复制协议的 WAL 消息中（参见第 54.4 节），消息流程通常与物理复制相同。Stream Start、Stream Stop、Stream Commit 和 Stream Abort 从协议版本 2 起可用。Begin Prepare、Prepare、Commit Prepared、Rollback Prepared 和 Stream Prepare 从协议版本 3 起可用。以下消息部分为上述消息所共用。"],"title":"协议上下文"}],"signature":"TupleData","sources":[{"label":"PostgreSQL 18 English manual","path":"protocol-logicalrep-message-formats.html","sha256":"e976b008206820fbeb1eba226e69bb7c00af157372c3545375d1b5053c76d0ad","url":"/docs/18/protocol-logicalrep-message-formats.html#PROTOCOL-LOGICALREP-MESSAGE-FORMATS-TUPLEDATA"}],"tables":[{"columns":[{"key":"c0","label":"Position"},{"key":"c1","label":"Format"},{"key":"c2","label":"Meaning"}],"key":"fields","rows":[{"c0":"1","c1":"Int16","c2":"Number of columns."},{"c0":"2","c1":"Byte1('n')","c2":"Identifies the data as NULL value."},{"c0":"3","c1":"Byte1('u')","c2":"Identifies unchanged TOASTed value (the actual value is not sent)."},{"c0":"4","c1":"Byte1('t')","c2":"Identifies the data as text formatted value."},{"c0":"5","c1":"Byte1('b')","c2":"Identifies the data as binary formatted value."},{"c0":"6","c1":"Int32","c2":"Length of the column value."},{"c0":"7","c1":"Byte n","c2":"The value of the column, either in binary or in text format. (As specified in the preceding format byte). n is the above length."}],"title":"Fields in documented order"}],"tables_zh":[{"columns":[{"key":"c0","label":"位置"},{"key":"c1","label":"格式"},{"key":"c2","label":"含义"}],"key":"fields","rows":[{"c0":"1","c1":"Int16","c2":"列数。"},{"c0":"2","c1":"Byte1('n')","c2":"将该数据标识为 NULL 值。"},{"c0":"3","c1":"Byte1('u')","c2":"标识经过 TOAST 处理且未更改的值（不发送实际值）。"},{"c0":"4","c1":"Byte1('t')","c2":"将该数据标识为文本格式的值。"},{"c0":"5","c1":"Byte1('b')","c2":"将该数据标识为二进制格式的值。"},{"c0":"6","c1":"Int32","c2":"列值的长度。"},{"c0":"7","c1":"Byte n","c2":"列值，采用二进制或文本格式（由前面的格式字节指定）。 n 为上述长度。"}],"title":"按手册顺序排列的字段"}],"zh_from":{"authored_translation":"source-derived-identity","body_sha256":"3158d2701cd67a43b70a30d333be6621b4db542497581aed67d7704af93b3575","kind":"same-version-chinese-manual-with-source-derived-identity","manual":{"anchor":"PROTOCOL-LOGICALREP-MESSAGE-FORMATS-TUPLEDATA","build_id":107,"extraction":"exact-definition","fragment_sha256":"ce7c515ddf23303caa5a77257d8e69060a22bbd33fd0cb3c5dff940d1f967f39","locale":"zh-Hans","page_key":"protocol-logicalrep-message-formats.html","source_hash":"9561d3a39aca911a61b68b188aa97828e60fb6f7d81323d8aada08fe67259039","source_revision":"unknown:rendered-translation-baseline","translated_from_revision":null,"translation_revision":"git:b1b500221dbe5437cfca004d6b04d3f6e422765d;html-sha256:08e987a66af27b98444a8057c256314eafa13611a3fb9e888214fc436824244b","url":"/zh/docs/18/protocol-logicalrep-message-formats.html#PROTOCOL-LOGICALREP-MESSAGE-FORMATS-TUPLEDATA","version":"18"},"runtime_rerun":false,"source_facts_revision":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f"}},"ManualEvidence":{"manual_path":"/docs/18/protocol-logicalrep-message-formats.html","release":{"channel":"stable","label":"18.6","major":"18","ref":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2","revision":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f"},"sources":[{"label":"PostgreSQL 18 English manual","path":"protocol-logicalrep-message-formats.html","sha256":"e976b008206820fbeb1eba226e69bb7c00af157372c3545375d1b5053c76d0ad","url":"/docs/18/protocol-logicalrep-message-formats.html#PROTOCOL-LOGICALREP-MESSAGE-FORMATS-TUPLEDATA"}]},"MeasuredEvidence":{}},"Text":{"Collection":"protocol","Key":"logical-tupledata","SourceDatabase":"center","Version":"18","Locale":"en","Title":"TupleData (logical replication)","Summary":"Logical replication TupleData format. Number of columns.","BodyHTML":"\u003cdl\u003e\u003cdd\u003e\n\u003cdiv\u003e\n\u003cdl\u003e\n\u003cdt\u003e\u003cspan\u003eInt16\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eNumber of columns.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003cp\u003eNext, one of the following submessages appears for each published column:\u003c/p\u003e\n\u003cdiv\u003e\n\u003cdl\u003e\n\u003cdt\u003e\u003cspan\u003eByte1(\u0026#39;n\u0026#39;)\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eIdentifies the data as NULL value.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003cp\u003eOr\u003c/p\u003e\n\u003cdiv\u003e\n\u003cdl\u003e\n\u003cdt\u003e\u003cspan\u003eByte1(\u0026#39;u\u0026#39;)\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eIdentifies unchanged TOASTed value (the actual value is not sent).\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003cp\u003eOr\u003c/p\u003e\n\u003cdiv\u003e\n\u003cdl\u003e\n\u003cdt\u003e\u003cspan\u003eByte1(\u0026#39;t\u0026#39;)\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eIdentifies the data as text formatted value.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003cp\u003eOr\u003c/p\u003e\n\u003cdiv\u003e\n\u003cdl\u003e\n\u003cdt\u003e\u003cspan\u003eByte1(\u0026#39;b\u0026#39;)\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eIdentifies the data as binary formatted value.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003eInt32\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eLength of the column value.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003eByte\u003cem\u003e\u003ccode\u003en\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eThe value of the column, either in binary or in text format. (As specified in the preceding format byte). \u003cem\u003e\u003ccode\u003en\u003c/code\u003e\u003c/em\u003e is the above length.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003c/dd\u003e\u003c/dl\u003e","SourceRevision":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","ContentHash":"5137be792d70d4fe9c49d6834cab830454fa20c4222ca62af0cbb996220d6c84","Payload":{"description":["Logical replication TupleData format. Number of columns."],"manual_html":"\u003cdl\u003e\u003cdd\u003e\n\u003cdiv class=\"variablelist\"\u003e\n\u003cdl class=\"variablelist\"\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003eInt16\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eNumber of columns.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003cp\u003eNext, one of the following submessages appears for each published column:\u003c/p\u003e\n\u003cdiv class=\"variablelist\"\u003e\n\u003cdl class=\"variablelist\"\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003eByte1('n')\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eIdentifies the data as NULL value.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003cp\u003eOr\u003c/p\u003e\n\u003cdiv class=\"variablelist\"\u003e\n\u003cdl class=\"variablelist\"\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003eByte1('u')\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eIdentifies unchanged TOASTed value (the actual value is not sent).\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003cp\u003eOr\u003c/p\u003e\n\u003cdiv class=\"variablelist\"\u003e\n\u003cdl class=\"variablelist\"\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003eByte1('t')\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eIdentifies the data as text formatted value.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003cp\u003eOr\u003c/p\u003e\n\u003cdiv class=\"variablelist\"\u003e\n\u003cdl class=\"variablelist\"\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003eByte1('b')\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eIdentifies the data as binary formatted value.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003eInt32\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eLength of the column value.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003eByte\u003cem class=\"replaceable\"\u003e\u003ccode\u003en\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eThe value of the column, either in binary or in text format. (As specified in the preceding format byte). \u003cem class=\"replaceable\"\u003e\u003ccode\u003en\u003c/code\u003e\u003c/em\u003e is the above length.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003c/dd\u003e\u003c/dl\u003e","related":[{"label":"Streaming replication protocol","url":"/docs/18/protocol-replication.html"},{"label":"Logical Decoding Plugins","url":"/wiki/decode/?v=18"}],"sections":[{"paragraphs":["This section describes the detailed format of each logical replication message. These messages are either returned by the replication slot SQL interface or are sent by a walsender. In the case of a walsender, they are encapsulated inside replication protocol WAL messages as described in Section 54.4 , and generally obey the same message flow as physical replication. The following messages (Stream Start, Stream Stop, Stream Commit, and Stream Abort) are available since protocol version 2. The following messages (Begin Prepare, Prepare, Commit Prepared, Rollback Prepared, Stream Prepare) are available since protocol version 3. The following message parts are shared by the above messages."],"title":"Protocol context"}],"tables":[{"columns":[{"key":"c0","label":"Position"},{"key":"c1","label":"Format"},{"key":"c2","label":"Meaning"}],"key":"fields","rows":[{"c0":"1","c1":"Int16","c2":"Number of columns."},{"c0":"2","c1":"Byte1('n')","c2":"Identifies the data as NULL value."},{"c0":"3","c1":"Byte1('u')","c2":"Identifies unchanged TOASTed value (the actual value is not sent)."},{"c0":"4","c1":"Byte1('t')","c2":"Identifies the data as text formatted value."},{"c0":"5","c1":"Byte1('b')","c2":"Identifies the data as binary formatted value."},{"c0":"6","c1":"Int32","c2":"Length of the column value."},{"c0":"7","c1":"Byte n","c2":"The value of the column, either in binary or in text format. (As specified in the preceding format byte). n is the above length."}],"title":"Fields in documented order"}]}},"RequestedLocale":"en","Fallback":false,"Versions":["10","11","12","13","14","15","16","17","18","19","20"],"Locales":["en","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
