{"Entry":{"collection":"protocol","key":"logical-rollback-prepared","name":"Rollback Prepared (logical replication)","aliases":["Rollback Prepared"],"metadata":{"aliases":["Rollback Prepared"],"category":"Logical replication formats","content_hash":"3b8b112e5198a45f8a8204afd58e8cc51d5b7d32a50924189d8ec31177d554f9","derived_content_hash":"9fa5d4a9ccaf33ec8e6053982303e08e000d2234c5a627e1b66b8aaa00550aa1","imported_at":"2026-09-30T00:40:44.643475+08:00","name":"Rollback Prepared (logical replication)","name_zh":"","slug":"logical-rollback-prepared","summary":"Logical replication Rollback Prepared format. Identifies the message as the rollback of a prepared transaction message."}},"Definition":{"Collection":"protocol","Key":"logical-rollback-prepared","SourceDatabase":"center","Version":"18","SourceTable":"protocol_message","SourceKey":"logical-rollback-prepared","SourceRevision":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","Facts":{"comparison_data":{"fields":[{"description":"Identifies the message as the rollback of a prepared transaction message.","format":"Byte1('r')"},{"description":"Flags; currently unused.","format":"Int8(0)"},{"description":"The end LSN of the prepared transaction.","format":"Int64 (XLogRecPtr)"},{"description":"The end LSN of the rollback of the prepared transaction.","format":"Int64 (XLogRecPtr)"},{"description":"Prepare timestamp of the transaction. The value is in number of microseconds since PostgreSQL epoch (2000-01-01).","format":"Int64 (TimestampTz)"},{"description":"Rollback timestamp of the transaction. The value is in number of microseconds since PostgreSQL epoch (2000-01-01).","format":"Int64 (TimestampTz)"},{"description":"Xid of the transaction.","format":"Int32 (TransactionId)"},{"description":"The user defined GID of the prepared transaction.","format":"String"}],"layer":"logical replication"},"comparison_hash":"f0fdcd5a4839f8a9bbb5bf70fcffebed6b9ba0886fd1aaff1764dee70f48056c","description":["Logical replication Rollback Prepared format. Identifies the message as the rollback of a prepared transaction message."],"description_zh":"Byte1('r') 将该消息标识为 Rollback Prepared 消息。 Int8(0) 标志；目前未使用。 Int64 (XLogRecPtr) 预备事务的结束 LSN。 Int64 (XLogRecPtr) 回滚预备事务的结束 LSN。 Int64 (TimestampTz) 事务进入预备状态的时间戳。其值为自 PostgreSQL 纪元（2000-01-01）起经过的微秒数。 Int64 (TimestampTz) 事务的回滚时间戳。该值是自 PostgreSQL 纪元（2000-01-01）以来的微秒数。 Int32 (TransactionId) 事务的 Xid。 String 预备事务的用户定义 GID。","description_zh_html":"\u003cp\u003e协议消息 Rollback Prepared。\u003c/p\u003e\u003ch3\u003e同版本中文手册定义\u003c/h3\u003e\u003cdd\u003e\u003cdiv class=\"variablelist\"\u003e\u003cdl class=\"variablelist\"\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003eByte1('r')\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n         将该消息标识为 Rollback Prepared 消息。\n        \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003eInt8(0)\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n         标志；目前未使用。\n        \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003eInt64 (XLogRecPtr)\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n         预备事务的结束 LSN。\n        \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003eInt64 (XLogRecPtr)\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n         回滚预备事务的结束 LSN。\n        \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003eInt64 (TimestampTz)\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n         事务进入预备状态的时间戳。其值为自 PostgreSQL 纪元（2000-01-01）起经过的微秒数。\n        \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003eInt64 (TimestampTz)\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n         事务的回滚时间戳。该值是自 PostgreSQL 纪元（2000-01-01）以来的微秒数。\n        \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003eInt32 (TransactionId)\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n         事务的 Xid。\n        \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003eString\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n         预备事务的用户定义 GID。\n        \u003c/p\u003e\u003c/dd\u003e\u003c/dl\u003e\u003c/div\u003e\u003c/dd\u003e\u003cp\u003e\u003ca href=\"/zh/docs/18/protocol-logicalrep-message-formats.html#PROTOCOL-LOGICALREP-MESSAGE-FORMATS-ROLLBACK-PREPARED\"\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":"Byte1('r')"}],"facts_zh":[{"label":"层次","value":"逻辑复制载荷，与前后端消息封装分开。"},{"label":"首个字段","value":"Byte1('r')"}],"fields":[{"description":"Identifies the message as the rollback of a prepared transaction message.","format":"Byte1('r')"},{"description":"Flags; currently unused.","format":"Int8(0)"},{"description":"The end LSN of the prepared transaction.","format":"Int64 (XLogRecPtr)"},{"description":"The end LSN of the rollback of the prepared transaction.","format":"Int64 (XLogRecPtr)"},{"description":"Prepare timestamp of the transaction. The value is in number of microseconds since PostgreSQL epoch (2000-01-01).","format":"Int64 (TimestampTz)"},{"description":"Rollback timestamp of the transaction. The value is in number of microseconds since PostgreSQL epoch (2000-01-01).","format":"Int64 (TimestampTz)"},{"description":"Xid of the transaction.","format":"Int32 (TransactionId)"},{"description":"The user defined GID of the prepared transaction.","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('r')\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eIdentifies the message as the rollback of a prepared transaction message.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003eInt8(0)\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eFlags; currently unused.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003eInt64 (XLogRecPtr)\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eThe end LSN of the prepared transaction.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003eInt64 (XLogRecPtr)\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eThe end LSN of the rollback of the prepared transaction.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003eInt64 (TimestampTz)\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrepare timestamp of the transaction. The value is in number of microseconds since PostgreSQL epoch (2000-01-01).\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003eInt64 (TimestampTz)\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eRollback timestamp of the transaction. The value is in number of microseconds since PostgreSQL epoch (2000-01-01).\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003eInt32 (TransactionId)\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eXid of the transaction.\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 user defined GID of the prepared transaction.\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":"Rollback Prepared","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-ROLLBACK-PREPARED"}],"tables":[{"columns":[{"key":"c0","label":"Position"},{"key":"c1","label":"Format"},{"key":"c2","label":"Meaning"}],"key":"fields","rows":[{"c0":"1","c1":"Byte1('r')","c2":"Identifies the message as the rollback of a prepared transaction message."},{"c0":"2","c1":"Int8(0)","c2":"Flags; currently unused."},{"c0":"3","c1":"Int64 (XLogRecPtr)","c2":"The end LSN of the prepared transaction."},{"c0":"4","c1":"Int64 (XLogRecPtr)","c2":"The end LSN of the rollback of the prepared transaction."},{"c0":"5","c1":"Int64 (TimestampTz)","c2":"Prepare timestamp of the transaction. The value is in number of microseconds since PostgreSQL epoch (2000-01-01)."},{"c0":"6","c1":"Int64 (TimestampTz)","c2":"Rollback timestamp of the transaction. The value is in number of microseconds since PostgreSQL epoch (2000-01-01)."},{"c0":"7","c1":"Int32 (TransactionId)","c2":"Xid of the transaction."},{"c0":"8","c1":"String","c2":"The user defined GID of the prepared transaction."}],"title":"Fields in documented order"}],"tables_zh":[{"columns":[{"key":"c0","label":"位置"},{"key":"c1","label":"格式"},{"key":"c2","label":"含义"}],"key":"fields","rows":[{"c0":"1","c1":"Byte1('r')","c2":"将该消息标识为 Rollback Prepared 消息。"},{"c0":"2","c1":"Int8(0)","c2":"标志；目前未使用。"},{"c0":"3","c1":"Int64 (XLogRecPtr)","c2":"预备事务的结束 LSN。"},{"c0":"4","c1":"Int64 (XLogRecPtr)","c2":"回滚预备事务的结束 LSN。"},{"c0":"5","c1":"Int64 (TimestampTz)","c2":"事务进入预备状态的时间戳。其值为自 PostgreSQL 纪元（2000-01-01）起经过的微秒数。"},{"c0":"6","c1":"Int64 (TimestampTz)","c2":"事务的回滚时间戳。该值是自PostgreSQL纪元（2000-01-01）以来的微秒数。"},{"c0":"7","c1":"Int32 (TransactionId)","c2":"事务的 Xid。"},{"c0":"8","c1":"字符串","c2":"预备事务的用户定义 GID。"}],"title":"按手册顺序排列的字段"}],"zh_from":{"authored_translation":"source-derived-identity","body_sha256":"e65b9a1b9c130bf87ea66c2ff271c9aea03c4d963c32db7cee8efd55bb7915ec","kind":"same-version-chinese-manual-with-source-derived-identity","manual":{"anchor":"PROTOCOL-LOGICALREP-MESSAGE-FORMATS-ROLLBACK-PREPARED","build_id":107,"extraction":"exact-definition","fragment_sha256":"7e9a62bd688366aff11ca4f226ba9a6e8a60e6d8cc13278649d459f263ad5e8d","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-ROLLBACK-PREPARED","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-ROLLBACK-PREPARED"}]},"MeasuredEvidence":{}},"Text":{"Collection":"protocol","Key":"logical-rollback-prepared","SourceDatabase":"center","Version":"18","Locale":"en","Title":"Rollback Prepared (logical replication)","Summary":"Logical replication Rollback Prepared format. Identifies the message as the rollback of a prepared transaction message.","BodyHTML":"\u003cdl\u003e\u003cdd\u003e\n\u003cdiv\u003e\n\u003cdl\u003e\n\u003cdt\u003e\u003cspan\u003eByte1(\u0026#39;r\u0026#39;)\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eIdentifies the message as the rollback of a prepared transaction message.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003eInt8(0)\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eFlags; currently unused.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003eInt64 (XLogRecPtr)\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eThe end LSN of the prepared transaction.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003eInt64 (XLogRecPtr)\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eThe end LSN of the rollback of the prepared transaction.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003eInt64 (TimestampTz)\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrepare timestamp of the transaction. The value is in number of microseconds since PostgreSQL epoch (2000-01-01).\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003eInt64 (TimestampTz)\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eRollback timestamp of the transaction. The value is in number of microseconds since PostgreSQL epoch (2000-01-01).\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003eInt32 (TransactionId)\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eXid of the transaction.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003eString\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eThe user defined GID of the prepared transaction.\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":"48f603722305098cd42c73dd5376aae4917b27afae958211b57860756852a8d4","Payload":{"description":["Logical replication Rollback Prepared format. Identifies the message as the rollback of a prepared transaction message."],"manual_html":"\u003cdl\u003e\u003cdd\u003e\n\u003cdiv class=\"variablelist\"\u003e\n\u003cdl class=\"variablelist\"\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003eByte1('r')\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eIdentifies the message as the rollback of a prepared transaction message.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003eInt8(0)\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eFlags; currently unused.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003eInt64 (XLogRecPtr)\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eThe end LSN of the prepared transaction.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003eInt64 (XLogRecPtr)\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eThe end LSN of the rollback of the prepared transaction.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003eInt64 (TimestampTz)\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrepare timestamp of the transaction. The value is in number of microseconds since PostgreSQL epoch (2000-01-01).\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003eInt64 (TimestampTz)\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eRollback timestamp of the transaction. The value is in number of microseconds since PostgreSQL epoch (2000-01-01).\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003eInt32 (TransactionId)\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eXid of the transaction.\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 user defined GID of the prepared transaction.\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":"Byte1('r')","c2":"Identifies the message as the rollback of a prepared transaction message."},{"c0":"2","c1":"Int8(0)","c2":"Flags; currently unused."},{"c0":"3","c1":"Int64 (XLogRecPtr)","c2":"The end LSN of the prepared transaction."},{"c0":"4","c1":"Int64 (XLogRecPtr)","c2":"The end LSN of the rollback of the prepared transaction."},{"c0":"5","c1":"Int64 (TimestampTz)","c2":"Prepare timestamp of the transaction. The value is in number of microseconds since PostgreSQL epoch (2000-01-01)."},{"c0":"6","c1":"Int64 (TimestampTz)","c2":"Rollback timestamp of the transaction. The value is in number of microseconds since PostgreSQL epoch (2000-01-01)."},{"c0":"7","c1":"Int32 (TransactionId)","c2":"Xid of the transaction."},{"c0":"8","c1":"String","c2":"The user defined GID of the prepared transaction."}],"title":"Fields in documented order"}]}},"RequestedLocale":"en","Fallback":false,"Versions":["15","16","17","18","19","20"],"Locales":["en","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
