{"Entry":{"collection":"protocol","key":"copybothresponse-b","name":"CopyBothResponse","aliases":["CopyBothResponse","Byte1('W')"],"metadata":{"aliases":["CopyBothResponse","Byte1('W')"],"category":"Backend messages","content_hash":"0c098b173922591f2fe40e91daeacaeda11bc99b37c7251888efb89dbeae98b8","derived_content_hash":"a6e2eafef2942bb05bc780e6af308b63585085b13ecac21ee7b10e73069be2c0","imported_at":"2026-09-30T00:40:44.449604+08:00","name":"CopyBothResponse","name_zh":"","slug":"copybothresponse-b","summary":"CopyBothResponse is a backend protocol message. Identifies the message as a Start Copy Both response. This message is used only for Streaming Replication."}},"Definition":{"Collection":"protocol","Key":"copybothresponse-b","SourceDatabase":"center","Version":"18","SourceTable":"protocol_message","SourceKey":"copybothresponse-b","SourceRevision":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","Facts":{"comparison_data":{"direction":"B","fields":[{"description":"Identifies the message as a Start Copy Both response. This message is used only for Streaming Replication.","format":"Byte1('W')"},{"description":"Length of message contents in bytes, including self.","format":"Int32"},{"description":"0 indicates the overall COPY format is textual (rows separated by newlines, columns separated by separator characters, etc.). 1 indicates the overall copy format is binary (similar to DataRow format). See COPY for more information.","format":"Int8"},{"description":"The number of columns in the data to be copied (denoted N below).","format":"Int16"},{"description":"The format codes to be used for each column. Each must presently be zero (text) or one (binary). All must be zero if the overall copy format is textual.","format":"Int16[ N ]"}]},"comparison_hash":"2c78768b935fbd770aa730611fc424919a4773d82ddeb631025f0ccbaf15aab4","description":["CopyBothResponse is a backend protocol message. Identifies the message as a Start Copy Both response. This message is used only for Streaming Replication."],"description_zh":"Byte1('W') 将该消息标识为开始双向 COPY 的响应。此消息仅用于流复制。 Int32 消息内容的长度（以字节为单位），包括其自身。 Int8 0 表示整体 COPY 格式是文本的（行由换行符分隔，列由分隔符分隔等）。1 表示整体复制格式是二进制的（类似于 DataRow 格式）。更多信息请参见 COPY 。 Int16 要复制的数据中的列数（以下用 N 表示）。 Int16[ N ] 各列使用的格式代码。目前每个代码必须为零（文本）或一（二进制）。如果整体复制格式为文本，则所有代码都必须为零。","description_zh_html":"\u003cp\u003e协议消息 CopyBothResponse (B)。\u003c/p\u003e\u003ch3\u003e同版本中文手册定义\u003c/h3\u003e\u003cdd\u003e\u003cdiv class=\"variablelist\"\u003e\u003cdl class=\"variablelist\"\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003eByte1('W')\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n         将该消息标识为开始双向 COPY 的响应。此消息仅用于流复制。\n        \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003eInt32\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n         消息内容的长度（以字节为单位），包括其自身。\n        \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003eInt8\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n         0 表示整体 \u003ccode class=\"command\"\u003eCOPY\u003c/code\u003e 格式是文本的（行由换行符分隔，列由分隔符分隔等）。1 表示整体复制格式是二进制的（类似于 DataRow 格式）。更多信息请参见 \u003ca class=\"xref\" href=\"/zh/docs/18/sql-copy.html\"\u003e\u003cspan class=\"refentrytitle\"\u003eCOPY\u003c/span\u003e\u003c/a\u003e。\n        \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003eInt16\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n         要复制的数据中的列数（以下用 \u003cem class=\"replaceable\"\u003e\u003ccode\u003eN\u003c/code\u003e\u003c/em\u003e 表示）。\n        \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003eInt16[\u003cem class=\"replaceable\"\u003e\u003ccode\u003eN\u003c/code\u003e\u003c/em\u003e]\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n         各列使用的格式代码。目前每个代码必须为零（文本）或一（二进制）。如果整体复制格式为文本，则所有代码都必须为零。\n        \u003c/p\u003e\u003c/dd\u003e\u003c/dl\u003e\u003c/div\u003e\u003c/dd\u003e\u003cp\u003e\u003ca href=\"/zh/docs/18/protocol-message-formats.html#PROTOCOL-MESSAGE-FORMATS-COPYBOTHRESPONSE\"\u003e查看完整中文手册与上下文\u003c/a\u003e。\u003c/p\u003e","direction":"B","facts":[{"label":"Direction","value":"Backend → frontend"},{"label":"First wire field","value":"Byte1('W')"},{"label":"Field entries","value":"5"},{"label":"Documented flow contexts","value":"COPY Operations"}],"facts_zh":[{"label":"方向","value":"后端 → 前端"},{"label":"首个线上协议字段","value":"Byte1('W')"},{"label":"字段条目","value":"5"},{"label":"手册中的交互阶段","value":"COPY 操作"}],"fields":[{"description":"Identifies the message as a Start Copy Both response. This message is used only for Streaming Replication.","format":"Byte1('W')"},{"description":"Length of message contents in bytes, including self.","format":"Int32"},{"description":"0 indicates the overall COPY format is textual (rows separated by newlines, columns separated by separator characters, etc.). 1 indicates the overall copy format is binary (similar to DataRow format). See COPY for more information.","format":"Int8"},{"description":"The number of columns in the data to be copied (denoted N below).","format":"Int16"},{"description":"The format codes to be used for each column. Each must presently be zero (text) or one (binary). All must be zero if the overall copy format is textual.","format":"Int16[ N ]"}],"manual_html":"\u003cdl\u003e\u003cdd\u003e\n\u003cdiv class=\"variablelist\"\u003e\n\u003cdl class=\"variablelist\"\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003eByte1('W')\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eIdentifies the message as a Start Copy Both response. This message is used only for Streaming Replication.\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 message contents in bytes, including self.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003eInt8\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003e0 indicates the overall \u003ccode class=\"command\"\u003eCOPY\u003c/code\u003e format is textual (rows separated by newlines, columns separated by separator characters, etc.). 1 indicates the overall copy format is binary (similar to DataRow format). See \u003ca class=\"xref\" href=\"/docs/18/sql-copy.html\" title=\"COPY\"\u003e\u003cspan class=\"refentrytitle\"\u003eCOPY\u003c/span\u003e\u003c/a\u003e for more information.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003eInt16\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eThe number of columns in the data to be copied (denoted \u003cem class=\"replaceable\"\u003e\u003ccode\u003eN\u003c/code\u003e\u003c/em\u003e below).\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003eInt16[\u003cem class=\"replaceable\"\u003e\u003ccode\u003eN\u003c/code\u003e\u003c/em\u003e]\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eThe format codes to be used for each column. Each must presently be zero (text) or one (binary). All must be zero if the overall copy format is textual.\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-message-formats.html","related":[{"label":"Protocol flow and exchange examples","url":"/docs/18/protocol-flow.html"},{"label":"Protocol overview","url":"/docs/18/protocol-overview.html"},{"label":"COPY Operations","url":"/docs/18/protocol-flow.html#PROTOCOL-COPY"}],"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":["The complete definition below retains repetition, counts and conditional fields. A numbered table row is a documented field definition, not a fixed byte offset. Integer encodings and flow rules follow the same-version protocol chapter."],"title":"Framing and repetition"}],"sections_zh":[{"paragraphs":["下方完整定义保留重复项、计数与条件字段。表格行号表示文档中的字段定义，并非固定字节偏移量。整数编码与交互流程以同版本协议章节为准。"],"title":"消息边界与重复字段"}],"signature":"CopyBothResponse (B)","sources":[{"label":"PostgreSQL 18 English manual","path":"protocol-message-formats.html","sha256":"53f37652ac2c089e30ada87d8aee7bdd0f26695b03f275302e526a807d2a1f23","url":"/docs/18/protocol-message-formats.html#PROTOCOL-MESSAGE-FORMATS-COPYBOTHRESPONSE"}],"tables":[{"columns":[{"key":"c0","label":"Position"},{"key":"c1","label":"Format"},{"key":"c2","label":"Meaning"}],"key":"fields","rows":[{"c0":"1","c1":"Byte1('W')","c2":"Identifies the message as a Start Copy Both response. This message is used only for Streaming Replication."},{"c0":"2","c1":"Int32","c2":"Length of message contents in bytes, including self."},{"c0":"3","c1":"Int8","c2":"0 indicates the overall COPY format is textual (rows separated by newlines, columns separated by separator characters, etc.). 1 indicates the overall copy format is binary (similar to DataRow format). See COPY for more information."},{"c0":"4","c1":"Int16","c2":"The number of columns in the data to be copied (denoted N below)."},{"c0":"5","c1":"Int16[ N ]","c2":"The format codes to be used for each column. Each must presently be zero (text) or one (binary). All must be zero if the overall copy format is textual."}],"title":"Wire fields in documented order"}],"tables_zh":[{"columns":[{"key":"c0","label":"位置"},{"key":"c1","label":"格式"},{"key":"c2","label":"含义"}],"key":"fields","rows":[{"c0":"1","c1":"Byte1('W')","c2":"将该消息标识为开始双向 COPY 的响应。此消息仅用于流复制。"},{"c0":"2","c1":"Int32","c2":"消息内容的长度（以字节为单位），包括其自身。"},{"c0":"3","c1":"Int8","c2":"0 表示 COPY 的整体格式为文本（用换行符分隔行、用分隔字符分隔列等）；1 表示整体格式为二进制（类似 DataRow 格式）。详情参见 COPY。"},{"c0":"4","c1":"Int16","c2":"要复制的数据中的列数（以下用 N 表示）。"},{"c0":"5","c1":"Int16[ N ]","c2":"各列使用的格式代码。目前每个代码必须为零（文本）或一（二进制）。如果整体复制格式为文本，则所有代码都必须为零。"}],"title":"按手册顺序排列的线上协议字段"}],"zh_from":{"authored_translation":"source-derived-identity","body_sha256":"ccda8b1f22faa4d9dfd642e6907241a98dd94e082585a3fe82d0d3abeaff186e","kind":"same-version-chinese-manual-with-source-derived-identity","manual":{"anchor":"PROTOCOL-MESSAGE-FORMATS-COPYBOTHRESPONSE","build_id":107,"extraction":"exact-definition","fragment_sha256":"a48b37bd6b8e92bcaa72cd0b48ec63fd645028e51c36a1790066c18d596e0520","locale":"zh-Hans","page_key":"protocol-message-formats.html","source_hash":"0be0a37b38d80c96c157ca9fcfe9222995654664aad8136f7ac2b1b552f6753a","source_revision":"unknown:rendered-translation-baseline","translated_from_revision":null,"translation_revision":"git:b1b500221dbe5437cfca004d6b04d3f6e422765d;html-sha256:08e987a66af27b98444a8057c256314eafa13611a3fb9e888214fc436824244b","url":"/zh/docs/18/protocol-message-formats.html#PROTOCOL-MESSAGE-FORMATS-COPYBOTHRESPONSE","version":"18"},"runtime_rerun":false,"source_facts_revision":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f"}},"ManualEvidence":{"manual_path":"/docs/18/protocol-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-message-formats.html","sha256":"53f37652ac2c089e30ada87d8aee7bdd0f26695b03f275302e526a807d2a1f23","url":"/docs/18/protocol-message-formats.html#PROTOCOL-MESSAGE-FORMATS-COPYBOTHRESPONSE"}]},"MeasuredEvidence":{}},"Text":{"Collection":"protocol","Key":"copybothresponse-b","SourceDatabase":"center","Version":"18","Locale":"en","Title":"CopyBothResponse","Summary":"CopyBothResponse is a backend protocol message. Identifies the message as a Start Copy Both response. This message is used only for Streaming Replication.","BodyHTML":"\u003cdl\u003e\u003cdd\u003e\n\u003cdiv\u003e\n\u003cdl\u003e\n\u003cdt\u003e\u003cspan\u003eByte1(\u0026#39;W\u0026#39;)\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eIdentifies the message as a Start Copy Both response. This message is used only for Streaming Replication.\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 message contents in bytes, including self.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003eInt8\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003e0 indicates the overall \u003ccode\u003eCOPY\u003c/code\u003e format is textual (rows separated by newlines, columns separated by separator characters, etc.). 1 indicates the overall copy format is binary (similar to DataRow format). See \u003ca href=\"/docs/18/sql-copy.html\" title=\"COPY\" rel=\"nofollow\"\u003e\u003cspan\u003eCOPY\u003c/span\u003e\u003c/a\u003e for more information.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003eInt16\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eThe number of columns in the data to be copied (denoted \u003cem\u003e\u003ccode\u003eN\u003c/code\u003e\u003c/em\u003e below).\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003eInt16[\u003cem\u003e\u003ccode\u003eN\u003c/code\u003e\u003c/em\u003e]\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eThe format codes to be used for each column. Each must presently be zero (text) or one (binary). All must be zero if the overall copy format is textual.\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":"67dc316472127837aae772ccbd0322e7da9cd8bdb61fb6052a5d07a101334f17","Payload":{"description":["CopyBothResponse is a backend protocol message. Identifies the message as a Start Copy Both response. This message is used only for Streaming Replication."],"manual_html":"\u003cdl\u003e\u003cdd\u003e\n\u003cdiv class=\"variablelist\"\u003e\n\u003cdl class=\"variablelist\"\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003eByte1('W')\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eIdentifies the message as a Start Copy Both response. This message is used only for Streaming Replication.\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 message contents in bytes, including self.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003eInt8\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003e0 indicates the overall \u003ccode class=\"command\"\u003eCOPY\u003c/code\u003e format is textual (rows separated by newlines, columns separated by separator characters, etc.). 1 indicates the overall copy format is binary (similar to DataRow format). See \u003ca class=\"xref\" href=\"/docs/18/sql-copy.html\" title=\"COPY\"\u003e\u003cspan class=\"refentrytitle\"\u003eCOPY\u003c/span\u003e\u003c/a\u003e for more information.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003eInt16\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eThe number of columns in the data to be copied (denoted \u003cem class=\"replaceable\"\u003e\u003ccode\u003eN\u003c/code\u003e\u003c/em\u003e below).\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003eInt16[\u003cem class=\"replaceable\"\u003e\u003ccode\u003eN\u003c/code\u003e\u003c/em\u003e]\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eThe format codes to be used for each column. Each must presently be zero (text) or one (binary). All must be zero if the overall copy format is textual.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003c/dd\u003e\u003c/dl\u003e","related":[{"label":"Protocol flow and exchange examples","url":"/docs/18/protocol-flow.html"},{"label":"Protocol overview","url":"/docs/18/protocol-overview.html"},{"label":"COPY Operations","url":"/docs/18/protocol-flow.html#PROTOCOL-COPY"}],"sections":[{"paragraphs":["The complete definition below retains repetition, counts and conditional fields. A numbered table row is a documented field definition, not a fixed byte offset. Integer encodings and flow rules follow the same-version protocol chapter."],"title":"Framing and repetition"}],"tables":[{"columns":[{"key":"c0","label":"Position"},{"key":"c1","label":"Format"},{"key":"c2","label":"Meaning"}],"key":"fields","rows":[{"c0":"1","c1":"Byte1('W')","c2":"Identifies the message as a Start Copy Both response. This message is used only for Streaming Replication."},{"c0":"2","c1":"Int32","c2":"Length of message contents in bytes, including self."},{"c0":"3","c1":"Int8","c2":"0 indicates the overall COPY format is textual (rows separated by newlines, columns separated by separator characters, etc.). 1 indicates the overall copy format is binary (similar to DataRow format). See COPY for more information."},{"c0":"4","c1":"Int16","c2":"The number of columns in the data to be copied (denoted N below)."},{"c0":"5","c1":"Int16[ N ]","c2":"The format codes to be used for each column. Each must presently be zero (text) or one (binary). All must be zero if the overall copy format is textual."}],"title":"Wire 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}
