{"Entry":{"collection":"protocol","key":"commandcomplete-b","name":"CommandComplete","aliases":["CommandComplete","Byte1('C')"],"metadata":{"aliases":["CommandComplete","Byte1('C')"],"category":"Backend messages","content_hash":"3754bc3fef940174be52fa331e6b3412a8012cbb8fb893871bb875d84aade97c","derived_content_hash":"efcdbd0102894292debfd1a45d87cd7817c13de96d9005d82ae4db8e3b26c4eb","imported_at":"2026-09-30T00:40:44.444951+08:00","name":"CommandComplete","name_zh":"","slug":"commandcomplete-b","summary":"CommandComplete is a backend protocol message. Identifies the message as a command-completed response."}},"Definition":{"Collection":"protocol","Key":"commandcomplete-b","SourceDatabase":"center","Version":"18","SourceTable":"protocol_message","SourceKey":"commandcomplete-b","SourceRevision":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","Facts":{"comparison_data":{"direction":"B","fields":[{"description":"Identifies the message as a command-completed response.","format":"Byte1('C')"},{"description":"Length of message contents in bytes, including self.","format":"Int32"},{"description":"The command tag. This is usually a single word that identifies which SQL command was completed. For an INSERT command, the tag is INSERT oid rows , where rows is the number of rows inserted. oid used to be the object ID of the inserted row if rows was 1 and the target table had OIDs, but OIDs system columns are not supported anymore; therefore oid is always 0. For a DELETE command, the tag is DELETE rows where rows is the number of rows deleted. For an UPDATE command, the tag is UPDATE rows where rows is the number of rows updated. For a MERGE command, the tag is MERGE rows where rows is the number of rows inserted, updated, or deleted. For a SELECT or CREATE TABLE AS command, the tag is SELECT rows where rows is the number of rows retrieved. For a MOVE command, the tag is MOVE rows where rows is the number of rows the cursor's position has been changed by. For a FETCH command, the tag is FETCH rows where rows is the number of rows that have been retrieved from the cursor. For a COPY command, the tag is COPY rows where rows is the number of rows copied. (Note: the row count appears only in PostgreSQL 8.2 and later.)","format":"String"}]},"comparison_hash":"019b4a212cb1c5ea4fd6978a8a4e5292dd1fa76fe5434ed7f0bd4f0e354af19f","description":["CommandComplete is a backend protocol message. Identifies the message as a command-completed response."],"description_zh":"Byte1('C') 将该消息标识为命令完成响应。 Int32 消息内容的长度（以字节为单位），包括其自身。 String 命令标签。通常是一个单词，用来标识已完成的 SQL 命令。 对于 INSERT 命令，标签是 INSERT oid rows ，其中 rows 是插入的行数。如果 rows 为 1 且目标表具有 OIDs，则 oid 曾经是插入行的对象 ID，但不再支持 OIDs 系统列；因此 oid 总是 0。 对于 DELETE 命令，标签是 DELETE rows ，其中 rows 表示删除的行数。 对于 UPDATE 命令，标签是 UPDATE rows ，其中 rows 是更新的行数。 对于 MERGE 命令，标签是 MERGE rows ，其中 rows 是插入、更新或删除的行数。 对于 SELECT 或 CREATE TABLE AS 命令，标签是 SELECT rows ，其中 rows 是检索到的行数。 对于 MOVE 命令，标签是 MOVE rows ，其中 rows 表示游标位置改变的行数。 对于 FETCH 命令，标签是 FETCH rows ，其中 rows 是从游标中检索出的行数。 对于 COPY 命令，标签为 COPY rows ，其中 rows 是复制的行数。（注意：行数仅出现在 PostgreSQL 8.2 及更高版本中。）","description_zh_html":"\u003cp\u003e协议消息 CommandComplete (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('C')\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n         将该消息标识为命令完成响应。\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\"\u003eString\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n        命令标签。通常是一个单词，用来标识已完成的 SQL 命令。\n       \u003c/p\u003e\u003cp\u003e\n        对于 \u003ccode class=\"command\"\u003eINSERT\u003c/code\u003e 命令，标签是\n        \u003ccode class=\"literal\"\u003eINSERT \u003cem class=\"replaceable\"\u003e\u003ccode\u003eoid\u003c/code\u003e\u003c/em\u003e\n\u003cem class=\"replaceable\"\u003e\u003ccode\u003erows\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e，其中\n        \u003cem class=\"replaceable\"\u003e\u003ccode\u003erows\u003c/code\u003e\u003c/em\u003e 是插入的行数。如果 \u003cem class=\"replaceable\"\u003e\u003ccode\u003erows\u003c/code\u003e\u003c/em\u003e 为 1 且目标表具有 OIDs，则 \u003cem class=\"replaceable\"\u003e\u003ccode\u003eoid\u003c/code\u003e\u003c/em\u003e 曾经是插入行的对象 ID，但不再支持 OIDs 系统列；因此 \u003cem class=\"replaceable\"\u003e\u003ccode\u003eoid\u003c/code\u003e\u003c/em\u003e\n        总是 0。\n       \u003c/p\u003e\u003cp\u003e\n        对于 \u003ccode class=\"command\"\u003eDELETE\u003c/code\u003e 命令，标签是 \u003ccode class=\"literal\"\u003eDELETE \u003cem class=\"replaceable\"\u003e\u003ccode\u003erows\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e，其中 \u003cem class=\"replaceable\"\u003e\u003ccode\u003erows\u003c/code\u003e\u003c/em\u003e 表示删除的行数。\n       \u003c/p\u003e\u003cp\u003e\n        对于 \u003ccode class=\"command\"\u003eUPDATE\u003c/code\u003e 命令，标签是 \u003ccode class=\"literal\"\u003eUPDATE \u003cem class=\"replaceable\"\u003e\u003ccode\u003erows\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e，其中 \u003cem class=\"replaceable\"\u003e\u003ccode\u003erows\u003c/code\u003e\u003c/em\u003e 是更新的行数。\n       \u003c/p\u003e\u003cp\u003e\n        对于 \u003ccode class=\"command\"\u003eMERGE\u003c/code\u003e 命令，标签是 \u003ccode class=\"literal\"\u003eMERGE \u003cem class=\"replaceable\"\u003e\u003ccode\u003erows\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e，其中 \u003cem class=\"replaceable\"\u003e\u003ccode\u003erows\u003c/code\u003e\u003c/em\u003e 是插入、更新或删除的行数。\n       \u003c/p\u003e\u003cp\u003e\n        对于 \u003ccode class=\"command\"\u003eSELECT\u003c/code\u003e 或 \u003ccode class=\"command\"\u003eCREATE TABLE AS\u003c/code\u003e 命令，标签是 \u003ccode class=\"literal\"\u003eSELECT \u003cem class=\"replaceable\"\u003e\u003ccode\u003erows\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e，其中 \u003cem class=\"replaceable\"\u003e\u003ccode\u003erows\u003c/code\u003e\u003c/em\u003e 是检索到的行数。\n       \u003c/p\u003e\u003cp\u003e\n        对于 \u003ccode class=\"command\"\u003eMOVE\u003c/code\u003e 命令，标签是 \u003ccode class=\"literal\"\u003eMOVE \u003cem class=\"replaceable\"\u003e\u003ccode\u003erows\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e，其中 \u003cem class=\"replaceable\"\u003e\u003ccode\u003erows\u003c/code\u003e\u003c/em\u003e 表示游标位置改变的行数。\n       \u003c/p\u003e\u003cp\u003e\n        对于 \u003ccode class=\"command\"\u003eFETCH\u003c/code\u003e 命令，标签是 \u003ccode class=\"literal\"\u003eFETCH \u003cem class=\"replaceable\"\u003e\u003ccode\u003erows\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e，其中 \u003cem class=\"replaceable\"\u003e\u003ccode\u003erows\u003c/code\u003e\u003c/em\u003e 是从游标中检索出的行数。\n       \u003c/p\u003e\u003cp\u003e\n        对于 \u003ccode class=\"command\"\u003eCOPY\u003c/code\u003e 命令，标签为 \u003ccode class=\"literal\"\u003eCOPY \u003cem class=\"replaceable\"\u003e\u003ccode\u003erows\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e，其中 \u003cem class=\"replaceable\"\u003e\u003ccode\u003erows\u003c/code\u003e\u003c/em\u003e 是复制的行数。（注意：行数仅出现在 \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e 8.2 及更高版本中。）\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-COMMANDCOMPLETE\"\u003e查看完整中文手册与上下文\u003c/a\u003e。\u003c/p\u003e","direction":"B","facts":[{"label":"Direction","value":"Backend → frontend"},{"label":"First wire field","value":"Byte1('C')"},{"label":"Field entries","value":"3"},{"label":"Documented flow contexts","value":"Simple Query; Extended Query; COPY Operations"}],"facts_zh":[{"label":"方向","value":"后端 → 前端"},{"label":"首个线上协议字段","value":"Byte1('C')"},{"label":"字段条目","value":"3"},{"label":"手册中的交互阶段","value":"简单查询；扩展查询；COPY 操作"}],"fields":[{"description":"Identifies the message as a command-completed response.","format":"Byte1('C')"},{"description":"Length of message contents in bytes, including self.","format":"Int32"},{"description":"The command tag. This is usually a single word that identifies which SQL command was completed. For an INSERT command, the tag is INSERT oid rows , where rows is the number of rows inserted. oid used to be the object ID of the inserted row if rows was 1 and the target table had OIDs, but OIDs system columns are not supported anymore; therefore oid is always 0. For a DELETE command, the tag is DELETE rows where rows is the number of rows deleted. For an UPDATE command, the tag is UPDATE rows where rows is the number of rows updated. For a MERGE command, the tag is MERGE rows where rows is the number of rows inserted, updated, or deleted. For a SELECT or CREATE TABLE AS command, the tag is SELECT rows where rows is the number of rows retrieved. For a MOVE command, the tag is MOVE rows where rows is the number of rows the cursor's position has been changed by. For a FETCH command, the tag is FETCH rows where rows is the number of rows that have been retrieved from the cursor. For a COPY command, the tag is COPY rows where rows is the number of rows copied. (Note: the row count appears only in PostgreSQL 8.2 and later.)","format":"String"}],"manual_html":"\u003cdl\u003e\u003cdd\u003e\n\u003cdiv class=\"variablelist\"\u003e\n\u003cdl class=\"variablelist\"\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003eByte1('C')\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eIdentifies the message as a command-completed response.\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\"\u003eString\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eThe command tag. This is usually a single word that identifies which SQL command was completed.\u003c/p\u003e\n\u003cp\u003eFor an \u003ccode class=\"command\"\u003eINSERT\u003c/code\u003e command, the tag is \u003ccode class=\"literal\"\u003eINSERT \u003cem class=\"replaceable\"\u003e\u003ccode\u003eoid\u003c/code\u003e\u003c/em\u003e \u003cem class=\"replaceable\"\u003e\u003ccode\u003erows\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e, where \u003cem class=\"replaceable\"\u003e\u003ccode\u003erows\u003c/code\u003e\u003c/em\u003e is the number of rows inserted. \u003cem class=\"replaceable\"\u003e\u003ccode\u003eoid\u003c/code\u003e\u003c/em\u003e used to be the object ID of the inserted row if \u003cem class=\"replaceable\"\u003e\u003ccode\u003erows\u003c/code\u003e\u003c/em\u003e was 1 and the target table had OIDs, but OIDs system columns are not supported anymore; therefore \u003cem class=\"replaceable\"\u003e\u003ccode\u003eoid\u003c/code\u003e\u003c/em\u003e is always 0.\u003c/p\u003e\n\u003cp\u003eFor a \u003ccode class=\"command\"\u003eDELETE\u003c/code\u003e command, the tag is \u003ccode class=\"literal\"\u003eDELETE \u003cem class=\"replaceable\"\u003e\u003ccode\u003erows\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e where \u003cem class=\"replaceable\"\u003e\u003ccode\u003erows\u003c/code\u003e\u003c/em\u003e is the number of rows deleted.\u003c/p\u003e\n\u003cp\u003eFor an \u003ccode class=\"command\"\u003eUPDATE\u003c/code\u003e command, the tag is \u003ccode class=\"literal\"\u003eUPDATE \u003cem class=\"replaceable\"\u003e\u003ccode\u003erows\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e where \u003cem class=\"replaceable\"\u003e\u003ccode\u003erows\u003c/code\u003e\u003c/em\u003e is the number of rows updated.\u003c/p\u003e\n\u003cp\u003eFor a \u003ccode class=\"command\"\u003eMERGE\u003c/code\u003e command, the tag is \u003ccode class=\"literal\"\u003eMERGE \u003cem class=\"replaceable\"\u003e\u003ccode\u003erows\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e where \u003cem class=\"replaceable\"\u003e\u003ccode\u003erows\u003c/code\u003e\u003c/em\u003e is the number of rows inserted, updated, or deleted.\u003c/p\u003e\n\u003cp\u003eFor a \u003ccode class=\"command\"\u003eSELECT\u003c/code\u003e or \u003ccode class=\"command\"\u003eCREATE TABLE AS\u003c/code\u003e command, the tag is \u003ccode class=\"literal\"\u003eSELECT \u003cem class=\"replaceable\"\u003e\u003ccode\u003erows\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e where \u003cem class=\"replaceable\"\u003e\u003ccode\u003erows\u003c/code\u003e\u003c/em\u003e is the number of rows retrieved.\u003c/p\u003e\n\u003cp\u003eFor a \u003ccode class=\"command\"\u003eMOVE\u003c/code\u003e command, the tag is \u003ccode class=\"literal\"\u003eMOVE \u003cem class=\"replaceable\"\u003e\u003ccode\u003erows\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e where \u003cem class=\"replaceable\"\u003e\u003ccode\u003erows\u003c/code\u003e\u003c/em\u003e is the number of rows the cursor's position has been changed by.\u003c/p\u003e\n\u003cp\u003eFor a \u003ccode class=\"command\"\u003eFETCH\u003c/code\u003e command, the tag is \u003ccode class=\"literal\"\u003eFETCH \u003cem class=\"replaceable\"\u003e\u003ccode\u003erows\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e where \u003cem class=\"replaceable\"\u003e\u003ccode\u003erows\u003c/code\u003e\u003c/em\u003e is the number of rows that have been retrieved from the cursor.\u003c/p\u003e\n\u003cp\u003eFor a \u003ccode class=\"command\"\u003eCOPY\u003c/code\u003e command, the tag is \u003ccode class=\"literal\"\u003eCOPY \u003cem class=\"replaceable\"\u003e\u003ccode\u003erows\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e where \u003cem class=\"replaceable\"\u003e\u003ccode\u003erows\u003c/code\u003e\u003c/em\u003e is the number of rows copied. (Note: the row count appears only in \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e 8.2 and later.)\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":"Simple Query","url":"/docs/18/protocol-flow.html#PROTOCOL-FLOW-SIMPLE-QUERY"},{"label":"Extended Query","url":"/docs/18/protocol-flow.html#PROTOCOL-FLOW-EXT-QUERY"},{"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":"CommandComplete (B)","sources":[{"label":"PostgreSQL 18 English manual","path":"protocol-message-formats.html","sha256":"53f37652ac2c089e30ada87d8aee7bdd0f26695b03f275302e526a807d2a1f23","url":"/docs/18/protocol-message-formats.html#PROTOCOL-MESSAGE-FORMATS-COMMANDCOMPLETE"}],"tables":[{"columns":[{"key":"c0","label":"Position"},{"key":"c1","label":"Format"},{"key":"c2","label":"Meaning"}],"key":"fields","rows":[{"c0":"1","c1":"Byte1('C')","c2":"Identifies the message as a command-completed response."},{"c0":"2","c1":"Int32","c2":"Length of message contents in bytes, including self."},{"c0":"3","c1":"String","c2":"The command tag. This is usually a single word that identifies which SQL command was completed. For an INSERT command, the tag is INSERT oid rows , where rows is the number of rows inserted. oid used to be the object ID of the inserted row if rows was 1 and the target table had OIDs, but OIDs system columns are not supported anymore; therefore oid is always 0. For a DELETE command, the tag is DELETE rows where rows is the number of rows deleted. For an UPDATE command, the tag is UPDATE rows where rows is the number of rows updated. For a MERGE command, the tag is MERGE rows where rows is the number of rows inserted, updated, or deleted. For a SELECT or CREATE TABLE AS command, the tag is SELECT rows where rows is the number of rows retrieved. For a MOVE command, the tag is MOVE rows where rows is the number of rows the cursor's position has been changed by. For a FETCH command, the tag is FETCH rows where rows is the number of rows that have been retrieved from the cursor. For a COPY command, the tag is COPY rows where rows is the number of rows copied. (Note: the row count appears only in PostgreSQL 8.2 and later.)"}],"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('C')","c2":"将该消息标识为命令完成响应。"},{"c0":"2","c1":"Int32","c2":"消息内容的长度（以字节为单位），包括其自身。"},{"c0":"3","c1":"字符串","c2":"命令标签，通常是标识已完成 SQL 命令的一个单词。对于 INSERT，标签为 INSERT oid rows，rows 是插入行数。oid 过去在 rows 为 1 且目标表具有 OID 时表示所插入行的对象 ID；由于 OID 系统列已不再受支持，oid 始终为 0。对于 DELETE，标签为 DELETE rows，rows 是删除行数。对于 UPDATE，标签为 UPDATE rows，rows 是更新行数。对于 MERGE，标签为 MERGE rows，rows 是插入、更新或删除的行数。对于 SELECT 或 CREATE TABLE AS，标签为 SELECT rows，rows 是检索行数。对于 MOVE，标签为 MOVE rows，rows 是游标位置移动的行数。对于 FETCH，标签为 FETCH rows，rows 是从游标检索的行数。对于 COPY，标签为 COPY rows，rows 是复制行数；行数仅在 PostgreSQL 8.2 及以后版本中出现。"}],"title":"按手册顺序排列的线上协议字段"}],"zh_from":{"authored_translation":"source-derived-identity","body_sha256":"a1d9b1347abc044c6a7aa16d1d1c55781917681fe6b4f11e1991e0b11e07f79c","kind":"same-version-chinese-manual-with-source-derived-identity","manual":{"anchor":"PROTOCOL-MESSAGE-FORMATS-COMMANDCOMPLETE","build_id":107,"extraction":"exact-definition","fragment_sha256":"deef0a9ce6eddf7a309b50ca6ddfe9bb2324214a3700e11fe080fc277fe29e1d","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-COMMANDCOMPLETE","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-COMMANDCOMPLETE"}]},"MeasuredEvidence":{}},"Text":{"Collection":"protocol","Key":"commandcomplete-b","SourceDatabase":"center","Version":"18","Locale":"en","Title":"CommandComplete","Summary":"CommandComplete is a backend protocol message. Identifies the message as a command-completed response.","BodyHTML":"\u003cdl\u003e\u003cdd\u003e\n\u003cdiv\u003e\n\u003cdl\u003e\n\u003cdt\u003e\u003cspan\u003eByte1(\u0026#39;C\u0026#39;)\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eIdentifies the message as a command-completed response.\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\u003eString\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eThe command tag. This is usually a single word that identifies which SQL command was completed.\u003c/p\u003e\n\u003cp\u003eFor an \u003ccode\u003eINSERT\u003c/code\u003e command, the tag is \u003ccode\u003eINSERT \u003cem\u003e\u003ccode\u003eoid\u003c/code\u003e\u003c/em\u003e \u003cem\u003e\u003ccode\u003erows\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e, where \u003cem\u003e\u003ccode\u003erows\u003c/code\u003e\u003c/em\u003e is the number of rows inserted. \u003cem\u003e\u003ccode\u003eoid\u003c/code\u003e\u003c/em\u003e used to be the object ID of the inserted row if \u003cem\u003e\u003ccode\u003erows\u003c/code\u003e\u003c/em\u003e was 1 and the target table had OIDs, but OIDs system columns are not supported anymore; therefore \u003cem\u003e\u003ccode\u003eoid\u003c/code\u003e\u003c/em\u003e is always 0.\u003c/p\u003e\n\u003cp\u003eFor a \u003ccode\u003eDELETE\u003c/code\u003e command, the tag is \u003ccode\u003eDELETE \u003cem\u003e\u003ccode\u003erows\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e where \u003cem\u003e\u003ccode\u003erows\u003c/code\u003e\u003c/em\u003e is the number of rows deleted.\u003c/p\u003e\n\u003cp\u003eFor an \u003ccode\u003eUPDATE\u003c/code\u003e command, the tag is \u003ccode\u003eUPDATE \u003cem\u003e\u003ccode\u003erows\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e where \u003cem\u003e\u003ccode\u003erows\u003c/code\u003e\u003c/em\u003e is the number of rows updated.\u003c/p\u003e\n\u003cp\u003eFor a \u003ccode\u003eMERGE\u003c/code\u003e command, the tag is \u003ccode\u003eMERGE \u003cem\u003e\u003ccode\u003erows\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e where \u003cem\u003e\u003ccode\u003erows\u003c/code\u003e\u003c/em\u003e is the number of rows inserted, updated, or deleted.\u003c/p\u003e\n\u003cp\u003eFor a \u003ccode\u003eSELECT\u003c/code\u003e or \u003ccode\u003eCREATE TABLE AS\u003c/code\u003e command, the tag is \u003ccode\u003eSELECT \u003cem\u003e\u003ccode\u003erows\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e where \u003cem\u003e\u003ccode\u003erows\u003c/code\u003e\u003c/em\u003e is the number of rows retrieved.\u003c/p\u003e\n\u003cp\u003eFor a \u003ccode\u003eMOVE\u003c/code\u003e command, the tag is \u003ccode\u003eMOVE \u003cem\u003e\u003ccode\u003erows\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e where \u003cem\u003e\u003ccode\u003erows\u003c/code\u003e\u003c/em\u003e is the number of rows the cursor\u0026#39;s position has been changed by.\u003c/p\u003e\n\u003cp\u003eFor a \u003ccode\u003eFETCH\u003c/code\u003e command, the tag is \u003ccode\u003eFETCH \u003cem\u003e\u003ccode\u003erows\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e where \u003cem\u003e\u003ccode\u003erows\u003c/code\u003e\u003c/em\u003e is the number of rows that have been retrieved from the cursor.\u003c/p\u003e\n\u003cp\u003eFor a \u003ccode\u003eCOPY\u003c/code\u003e command, the tag is \u003ccode\u003eCOPY \u003cem\u003e\u003ccode\u003erows\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e where \u003cem\u003e\u003ccode\u003erows\u003c/code\u003e\u003c/em\u003e is the number of rows copied. (Note: the row count appears only in \u003cspan\u003ePostgreSQL\u003c/span\u003e 8.2 and later.)\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":"4ea94f71f9f8fda89ccb66112a9767e739e90292d8437e13126d8f548975e2cc","Payload":{"description":["CommandComplete is a backend protocol message. Identifies the message as a command-completed response."],"manual_html":"\u003cdl\u003e\u003cdd\u003e\n\u003cdiv class=\"variablelist\"\u003e\n\u003cdl class=\"variablelist\"\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003eByte1('C')\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eIdentifies the message as a command-completed response.\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\"\u003eString\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eThe command tag. This is usually a single word that identifies which SQL command was completed.\u003c/p\u003e\n\u003cp\u003eFor an \u003ccode class=\"command\"\u003eINSERT\u003c/code\u003e command, the tag is \u003ccode class=\"literal\"\u003eINSERT \u003cem class=\"replaceable\"\u003e\u003ccode\u003eoid\u003c/code\u003e\u003c/em\u003e \u003cem class=\"replaceable\"\u003e\u003ccode\u003erows\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e, where \u003cem class=\"replaceable\"\u003e\u003ccode\u003erows\u003c/code\u003e\u003c/em\u003e is the number of rows inserted. \u003cem class=\"replaceable\"\u003e\u003ccode\u003eoid\u003c/code\u003e\u003c/em\u003e used to be the object ID of the inserted row if \u003cem class=\"replaceable\"\u003e\u003ccode\u003erows\u003c/code\u003e\u003c/em\u003e was 1 and the target table had OIDs, but OIDs system columns are not supported anymore; therefore \u003cem class=\"replaceable\"\u003e\u003ccode\u003eoid\u003c/code\u003e\u003c/em\u003e is always 0.\u003c/p\u003e\n\u003cp\u003eFor a \u003ccode class=\"command\"\u003eDELETE\u003c/code\u003e command, the tag is \u003ccode class=\"literal\"\u003eDELETE \u003cem class=\"replaceable\"\u003e\u003ccode\u003erows\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e where \u003cem class=\"replaceable\"\u003e\u003ccode\u003erows\u003c/code\u003e\u003c/em\u003e is the number of rows deleted.\u003c/p\u003e\n\u003cp\u003eFor an \u003ccode class=\"command\"\u003eUPDATE\u003c/code\u003e command, the tag is \u003ccode class=\"literal\"\u003eUPDATE \u003cem class=\"replaceable\"\u003e\u003ccode\u003erows\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e where \u003cem class=\"replaceable\"\u003e\u003ccode\u003erows\u003c/code\u003e\u003c/em\u003e is the number of rows updated.\u003c/p\u003e\n\u003cp\u003eFor a \u003ccode class=\"command\"\u003eMERGE\u003c/code\u003e command, the tag is \u003ccode class=\"literal\"\u003eMERGE \u003cem class=\"replaceable\"\u003e\u003ccode\u003erows\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e where \u003cem class=\"replaceable\"\u003e\u003ccode\u003erows\u003c/code\u003e\u003c/em\u003e is the number of rows inserted, updated, or deleted.\u003c/p\u003e\n\u003cp\u003eFor a \u003ccode class=\"command\"\u003eSELECT\u003c/code\u003e or \u003ccode class=\"command\"\u003eCREATE TABLE AS\u003c/code\u003e command, the tag is \u003ccode class=\"literal\"\u003eSELECT \u003cem class=\"replaceable\"\u003e\u003ccode\u003erows\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e where \u003cem class=\"replaceable\"\u003e\u003ccode\u003erows\u003c/code\u003e\u003c/em\u003e is the number of rows retrieved.\u003c/p\u003e\n\u003cp\u003eFor a \u003ccode class=\"command\"\u003eMOVE\u003c/code\u003e command, the tag is \u003ccode class=\"literal\"\u003eMOVE \u003cem class=\"replaceable\"\u003e\u003ccode\u003erows\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e where \u003cem class=\"replaceable\"\u003e\u003ccode\u003erows\u003c/code\u003e\u003c/em\u003e is the number of rows the cursor's position has been changed by.\u003c/p\u003e\n\u003cp\u003eFor a \u003ccode class=\"command\"\u003eFETCH\u003c/code\u003e command, the tag is \u003ccode class=\"literal\"\u003eFETCH \u003cem class=\"replaceable\"\u003e\u003ccode\u003erows\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e where \u003cem class=\"replaceable\"\u003e\u003ccode\u003erows\u003c/code\u003e\u003c/em\u003e is the number of rows that have been retrieved from the cursor.\u003c/p\u003e\n\u003cp\u003eFor a \u003ccode class=\"command\"\u003eCOPY\u003c/code\u003e command, the tag is \u003ccode class=\"literal\"\u003eCOPY \u003cem class=\"replaceable\"\u003e\u003ccode\u003erows\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e where \u003cem class=\"replaceable\"\u003e\u003ccode\u003erows\u003c/code\u003e\u003c/em\u003e is the number of rows copied. (Note: the row count appears only in \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e 8.2 and later.)\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":"Simple Query","url":"/docs/18/protocol-flow.html#PROTOCOL-FLOW-SIMPLE-QUERY"},{"label":"Extended Query","url":"/docs/18/protocol-flow.html#PROTOCOL-FLOW-EXT-QUERY"},{"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('C')","c2":"Identifies the message as a command-completed response."},{"c0":"2","c1":"Int32","c2":"Length of message contents in bytes, including self."},{"c0":"3","c1":"String","c2":"The command tag. This is usually a single word that identifies which SQL command was completed. For an INSERT command, the tag is INSERT oid rows , where rows is the number of rows inserted. oid used to be the object ID of the inserted row if rows was 1 and the target table had OIDs, but OIDs system columns are not supported anymore; therefore oid is always 0. For a DELETE command, the tag is DELETE rows where rows is the number of rows deleted. For an UPDATE command, the tag is UPDATE rows where rows is the number of rows updated. For a MERGE command, the tag is MERGE rows where rows is the number of rows inserted, updated, or deleted. For a SELECT or CREATE TABLE AS command, the tag is SELECT rows where rows is the number of rows retrieved. For a MOVE command, the tag is MOVE rows where rows is the number of rows the cursor's position has been changed by. For a FETCH command, the tag is FETCH rows where rows is the number of rows that have been retrieved from the cursor. For a COPY command, the tag is COPY rows where rows is the number of rows copied. (Note: the row count appears only in PostgreSQL 8.2 and later.)"}],"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}
