NoticeResponse
NoticeResponse 是后端协议消息,表示通知信息(notice)。
当前查看 PostgreSQL 18.6。
说明
NoticeResponse 是后端协议消息,表示通知信息(notice)。
- 方向
- 后端 → 前端
- 首个线上协议字段
- Byte1('N')
- 字段条目
- 4
- 手册中的交互阶段
- 启动;简单查询;函数调用;COPY 操作;异步操作
用法
NoticeResponse (B)消息边界与重复字段
下方完整定义保留重复项、计数与条件字段。表格行号表示文档中的字段定义,并非固定字节偏移量。整数编码与交互流程以同版本协议章节为准。
按手册顺序排列的线上协议字段
| 位置 | 格式 | 含义 |
|---|---|---|
| 1 | Byte1('N') | 将消息标识为通知。 |
| 2 | Int32 | 消息内容的长度(以字节为单位),包括其自身。 |
| 3 | Byte1 | 一个用于标识字段类型的代码;如果为零,则这是消息终止符,后面没有字符串。目前定义的字段类型列在 第 54.8 节 中。由于将来可能会添加更多的字段类型,前端应该静默地忽略未识别类型的字段。 |
| 4 | 字符串 | 字段值。 |
手册定义
-
- Byte1('N')
-
将消息标识为通知。
- Int32
-
消息内容的长度(以字节为单位),包括其自身。
消息体由一个或多个带标识的字段组成,最后以一个零字节终止。字段可以按任意顺序出现。每个字段包含以下内容:
- Byte1
-
一个用于标识字段类型的代码;如果为零,则这是消息终止符,后面没有字符串。目前定义的字段类型列在第 54.8 节中。由于将来可能会添加更多的字段类型,前端应该静默地忽略未识别类型的字段。
- 字符串
-
字段值。
相关条目
文档与源码
来源构建
- 版本
- 18.6
- 构建
- https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2
- 来源指纹
555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f
版本比较
PostgreSQL 10 → 11: 属性变化。
以下差异保留原始字段名与英文源描述。
--- PostgreSQL 10
+++ PostgreSQL 11
@@ -10,7 +10,7 @@
"format": "Int32"
},
{
- "description": "A code identifying the field type; if zero, this is the message terminator and no string follows. The presently defined field types are listed in Section 52.8 . Since more field types might be added in future, frontends should silently ignore fields of unrecognized type.",
+ "description": "A code identifying the field type; if zero, this is the message terminator and no string follows. The presently defined field types are listed in Section 53.8 . Since more field types might be added in future, frontends should silently ignore fields of unrecognized type.",
"format": "Byte1"
},
{
比较已记录的接口与属性,排除来源指纹和构建元数据。某个样本中没有记录,不能据此判断实际引入或移除的版本。
相关条目
导出 JSON · 返回协议消息 · 收录范围为 PostgreSQL 10 至 20;最早采样版本不一定是实际引入版本。