↑↓ 选择↵ 打开⌫ 切换范围完整搜索

PG.CENTER 连接 PostgreSQL 文档、百科与生态知识。由 Pigsty 维护。

Wiki / SQLSTATE

08P01 — 协议违规(protocol_violation)

前后端消息违反线路协议,通常是 FATAL。

英文手册覆盖始于 PostgreSQL 8.1. 来源历史与运行验证各自保留独立版本边界。

当前阅读 PG 18·选择有来源记录的版本

aliases
未知
class name
Connection Exception
condition name
protocol_violation
lang
en
sqlstate
08P01

版本定义 PG 18

08P01 — 协议违规

速览 {#at-a-glance}

SQLSTATE 08P01 是 Class 08 中的 protocol_violation。08P01 表示前端/后端消息违反线路协议。选定原始 TCP 案例先完成启动并观察 ReadyForQuery(Z),再在合法帧中发送未知前端字节 Y,收到 C=08P01、S=FATAL、主报文 invalid frontend message type 89,并在客户端关闭 socket 前读到服务器 EOF。

含义 {#meaning}

服务器协议解析器先接受启动交换,随后在派发 SQL 前拒绝未知的前端消息类型。选定路径为 FATAL invalid frontend message type 89,之后服务器发送 EOF;因此它是受影响 socket 的同步边界,不是 SQL 解析错误。

关键边界在于线路状态,而不是 SQL 文本。客户端可以已经到达 ReadyForQuery,却在下一条消息中发送错误类型,选定案例正是如此;启动帧损坏或代理改变帧边界也可能更早失败,并且可能没有可用会话。选定运行覆盖未知消息分派分支;下面的固定源码证据还覆盖不同的 Bind 和 message-buffer 解析分支,其他传输故障必须依据自身的 ErrorResponse 或日志判断。

08P01 并不意味着固定的严重级别或 socket 结果。在固定的 extended-query 路径中,Bind 消息的 parameter-format 数量或参数数量不匹配时报告 ERROR;顶层循环中止当前命令,等待协议规定的 Sync,然后才继续下一个 ReadyForQuery。固定的 message-buffer 读取器在缺少字节、字符串无效或报文尾部有数据时也使用 ERROR。这些可恢复的协议错误不同于未知消息类型:后者是 FATAL 边界,因为服务器不能再信任消息同步状态。

诊断 {#diagnosis}

检查驱动或代理的协议版本、消息类型、帧长度、启动模式和连接所有权。选定证据中的 collector 是收集原始协议 ErrorResponse(C/S/M 及服务器 EOF)的对象,不是 csvlog/jsonlog。服务器关闭产生 FATAL 的 socket,案例不会复用它;独立的运行器连接能执行 SELECT 1 并保持 IDLE。这是线路协议边界,不是 SQL 语法,也不是客户端自行创建的 SQLSTATE。

按阶段解释恢复:

  • 启动完成前没有会话级事务,驱动可能只有连接异常;如果服务器发过响应,应保留原始线路记录。
  • 启动到达 Z 后,未知前端消息会在已建立后端中被拒绝,但选定分支是 FATAL,随后服务器关闭该 socket。即使客户端在协议失步前已经开始工作,也不能在这个 socket 上发送 ROLLBACK。
  • 经过连接池或代理时,要比较所有者实际发送的字节与服务器期望的协议版本和帧格式。另一条连接上的 SELECT 1 只证明可达,不证明在途请求已经提交。

先根据主报文识别分支,再选择恢复动作。bind message has ... parameter formats 和 bind message supplies ... parameters 指向 extended-query 数量契约;no data left in message、insufficient data left in message、invalid string in message 和 invalid message format 指向报文主体或边界损坏。这些源码定义的 ERROR 变体在驱动仍能保持帧边界时可能通过 Sync 恢复;带 FATAL 的 invalid frontend message type ... 则表示选定 socket 已经失效。

处理 {#response}

收到 FATAL 或服务器 EOF 时,关闭并丢弃受影响的 socket,修正协议或代理帧后重新连接。extended-query 的 ERROR 应让驱动发送协议有效的 Sync 并等待 ReadyForQuery,然后检查事务状态;Sync 不会回滚失败的显式事务,状态为 E 时仍须执行 ROLLBACK 或回到有意建立的保存点。若非幂等请求在途中,重放前先核对结果。独立探针只证明新连接可用。

将选定案例视为会话终止分支:读到服务器 EOF 后建立新连接,并且只重做已核对且具幂等性的操作。如果违规发生在会话建立前,应先修正启动或代理配置。只有客户端解析器异常或 socket 关闭而没有服务器 C 字段,不能把事件标成 08P01。

不要自行拼接字节,也不要把事务当作已经提交。若驱动无法保持报文边界或不实现 Sync 契约,应丢弃连接并核对请求结果。这一源码流程不改变选定未知字节运行:该案例的 FATAL socket 必须丢弃。

报文 {#messages}

固定的协议解析路径以 FATAL 发出主报文 invalid frontend message type %d,其中字节数值是动态的。选定的 Y 字节记录为 89。SQLSTATE 的依据是原始 ErrorResponse,而不是客户端异常。

其他固定源码分支以 ERROR 发出以下主报文模板:

  • bind message has %d parameter formats but %d parameters
  • bind message supplies %d parameters, but prepared statement "%s" requires %d
  • no data left in message
  • insufficient data left in message
  • invalid string in message
  • invalid message format

这些 Bind 和 message-buffer 变体在本页中是源码证据,不是新增运行观察,也不会全部终止 socket。

选定的线路顺序是:启动交换 → Z ReadyForQuery → 合法帧中的类型字节 Y(十进制 89)→ ErrorResponse C=08P01、S=FATAL、M=invalid frontend message type 89 → 服务器 EOF。collector 直接收集这些协议字段和 EOF,既不是 csvlog/jsonlog 记录,也不是后续独立探针。

代表案例 {#case}

SQL 探针用于检查独立连接。真实触发是运行器拥有的 TCP 握手后发送未知前端消息字节,不能只用 SQL 表达。

SELECT 1;

18.6 服务器记录为 C=08P01、S=FATAL、主报文 invalid frontend message type 89;启动到达 Z,服务器 EOF 断言为 True,独立探针返回 1,状态 IDLE。因此没有复用触发错误的连接。

可下载的案例与证据投影分别是 08P01 案例 JSON 和 作者证据。运行器清单为 verify/cases/08P01/cases.json;发布前会将页面 SQL 与共享注册表比对。

版本 {#versions}

上面的生成事实表记录锁定的目录快照和最早观察到的定义。本页自然运行范围是 PostgreSQL 18.6 与 10.21,不能据此推断所有中间版本的行为。

相关 {#related}

来源 {#sources}

  • src.protocol-invalid-frontend.18.6 — src/backend/tcop/postgres.c at REL_18_6 commit 724edf9bde9d356724ad384a2e196edc3c9f80f7; fixed blob SHA-256 9fb62275b1badf94d01ab351337b60410cd9b3ab1fe63fa9f23d6d2185a21061 (source).
  • src.protocol-invalid-frontend.10.23 — src/backend/tcop/postgres.c at REL_10_23 commit 02991e79f8f58bc208f05dcc8af0c62dbe0a6ea4; fixed blob SHA-256 badfe30749794afa80a799dcdbd142fd4e4732ac1c913002d365549ae5313497 (source).
  • src.postgres-bind.10.23 — src/backend/tcop/postgres.c at REL_10_23 commit 02991e79f8f58bc208f05dcc8af0c62dbe0a6ea4; fixed blob SHA-256 badfe30749794afa80a799dcdbd142fd4e4732ac1c913002d365549ae5313497 (source).
  • src.pqformat.10.23 — src/backend/libpq/pqformat.c at REL_10_23 commit 02991e79f8f58bc208f05dcc8af0c62dbe0a6ea4; fixed blob SHA-256 637923dbf2b9d9a0610350784f3b1d7d36a545cd8a6bd2cbe6272d9549873a91 (source).
  • src.postgres-sync.10.23 — src/backend/tcop/postgres.c at REL_10_23 commit 02991e79f8f58bc208f05dcc8af0c62dbe0a6ea4; fixed blob SHA-256 badfe30749794afa80a799dcdbd142fd4e4732ac1c913002d365549ae5313497 (source).
  • src.calls.REL_18_6 / src.calls.REL_10_23 — fixed local call scans, SHA-256 9ee8a0e81d8f0825c5c1ae45583439859a26e602bdd4ce2f2a62aa278867ccbf / 00d16d3eb01b71ccf1b245c8f3102f9d0ec9f36fb02777b8dd1b99fcb263040c; these scans preserve the resolved call context used by the claims.

比较版本

SQLSTATE 证据与已记录的运行版本

cases · protocol_violation
{
  "assertions": [
    "The selected server diagnostic has the expected SQLSTATE",
    "The selected recovery/probe assertions pass",
    "Runner-owned resources are cleaned up"
  ],
  "case_id": "protocol_violation",
  "cleanup": "Drop the case schema with an owner connection.",
  "has_snippet": true,
  "position": 0,
  "preconditions": [
    "A runner-owned disposable target is provisioned."
  ],
  "repair": "Follow the case-specific repair statements and verify the resulting state.",
  "trigger": "Complete a startup handshake, then send a correctly framed unknown frontend message type.",
  "versions": [
    "10",
    "18"
  ]
}
claims · identity.class-and-condition
{
  "claim_id": "identity.class-and-condition",
  "limits": "Directory identity does not identify every backend or client path.",
  "method": "Read the fixed errcodes.txt definition and the locked catalogue metadata.",
  "position": 0,
  "runtime": [],
  "sources": [
    "src.errcodes.18.6"
  ],
  "statement": "08P01 is the protocol_violation condition in Class 08."
}
claims · mechanism.backend-path
{
  "claim_id": "mechanism.backend-path",
  "limits": "Other calls can retain the same SQLSTATE with different context or text.",
  "method": "Trace the resolved source call records at the fixed release commits and compare their dynamic message fields.",
  "position": 1,
  "runtime": [],
  "sources": [
    "src.protocol-invalid-frontend.18.6",
    "src.protocol-invalid-frontend.10.23"
  ],
  "statement": "The fixed source paths associated with 08P01 report the condition in the mechanism selected for this page."
}
claims · extended-query-error-recovery
{
  "claim_id": "extended-query-error-recovery",
  "limits": "This is a REL_10_23 source contract; no Bind or Sync runtime was selected in this batch, and a driver must send a valid Sync rather than arbitrary bytes.",
  "method": "Read the complete REL_10_23 exec_bind_message branch and the surrounding top-level error-recovery and Sync handling in postgres.c.",
  "position": 2,
  "runtime": [],
  "sources": [
    "src.postgres-bind.10.23",
    "src.postgres-sync.10.23"
  ],
  "statement": "The fixed extended-query Bind path reports ERROR 08P01 for parameter-format cardinality mismatches or a parameter count that differs from the prepared statement. After an ERROR while processing an extended-query message, the top-level loop skips messages until a protocol-valid Sync and then resumes the normal ReadyForQuery flow; this ERROR path is distinct from the unknown frontend type FATAL branch."
}
claims · message-buffer-boundary
{
  "claim_id": "message-buffer-boundary",
  "limits": "The exact branch depends on the parser and message framing; this source scan does not select a natural runtime or generalize every malformed frame.",
  "method": "Read pq_getmsgbyte, pq_getmsgbytes/pq_copymsgbytes, pq_getmsgstring/pq_getmsgrawstring, and pq_getmsgend in the fixed pqformat.c source.",
  "position": 3,
  "runtime": [],
  "sources": [
    "src.pqformat.10.23"
  ],
  "statement": "The fixed REL_10_23 pqformat readers report ERROR 08P01 for a depleted message, insufficient bytes, an invalid string, or trailing message data. These parser errors are source-only examples of protocol_violation and do not imply the unknown-message FATAL socket termination."
}
claims · runtime.representative-case
{
  "claim_id": "runtime.representative-case",
  "limits": "This covers the selected case and versions only; it does not generalize to every driver, proxy, or intermediate release.",
  "method": "Run the shared registry case on isolated runner-owned latest and PG10 targets; inspect the final summaries and raw results.",
  "position": 4,
  "runtime": [
    "runtime.08P01-eof-repair-latest.latest",
    "runtime.08P01-eof-repair-pg10.pg10"
  ],
  "sources": [
    "snippet-registry.08P01",
    "manifest.08P01"
  ],
  "statement": "The selected protocol_violation case passed with the expected structured diagnostics, recovery assertions, and cleanup on PostgreSQL 18.6 and 10.21."
}
claims · protocol-phase-boundary
{
  "claim_id": "protocol-phase-boundary",
  "limits": "The selected runtime covers one unknown frontend byte and does not generalize to every framing, proxy, or startup failure.",
  "method": "Compare the fixed postgres.c dispatch path, the protocol error-field contract, and the selected raw collector sequence.",
  "position": 5,
  "runtime": [],
  "sources": [
    "src.protocol-invalid-frontend.18.6",
    "doc.protocol.18",
    "runtime.representative-case"
  ],
  "statement": "The selected unknown-message branch occurs after startup reaches ReadyForQuery, emits a FATAL ErrorResponse, and closes the affected socket; a pre-session protocol failure has no session transaction, and a client EOF without the server ErrorResponse is not sufficient to assign 08P01."
}
claims · versions.catalogue-boundary
{
  "claim_id": "versions.catalogue-boundary",
  "limits": "Presence in a definition file is not an exact behavioral introduction; the two runtime targets do not prove all middle versions.",
  "method": "Read the generated facts block and locked manifest, then compare the selected target summaries.",
  "position": 6,
  "runtime": [],
  "sources": [
    "src.errcodes.18.6",
    "src.calls.REL_18_6",
    "src.calls.REL_10_23"
  ],
  "statement": "The locked catalogue records 08P01 in the listed snapshots; the runtime comparison here is limited to PostgreSQL 18.6 and 10.21."
}
messages · message.protocol-invalid-frontend
{
  "limits": "",
  "message_id": "message.protocol-invalid-frontend",
  "path": "",
  "position": 0,
  "raw": {
    "id": "message.protocol-invalid-frontend",
    "primary_template": "invalid frontend message type %d",
    "severity_source": "explicit FATAL",
    "sources": [
      "src.protocol-invalid-frontend.18.6",
      "src.protocol-invalid-frontend.10.23"
    ],
    "sqlstate": "08P01"
  },
  "severity": "explicit FATAL",
  "sources": [
    "src.protocol-invalid-frontend.18.6",
    "src.protocol-invalid-frontend.10.23"
  ],
  "templates": [
    {
      "kind": "primary",
      "literal": "invalid frontend message type",
      "position": 0,
      "role": "",
      "template": "invalid frontend message type %d"
    }
  ]
}
messages · message.bind-format-count
{
  "limits": "",
  "message_id": "message.bind-format-count",
  "path": "",
  "position": 1,
  "raw": {
    "id": "message.bind-format-count",
    "primary_template": "bind message has %d parameter formats but %d parameters",
    "severity_source": "explicit ERROR",
    "sources": [
      "src.postgres-bind.10.23"
    ],
    "sqlstate": "08P01"
  },
  "severity": "explicit ERROR",
  "sources": [
    "src.postgres-bind.10.23"
  ],
  "templates": [
    {
      "kind": "primary",
      "literal": "bind message has parameter formats but parameters",
      "position": 0,
      "role": "",
      "template": "bind message has %d parameter formats but %d parameters"
    }
  ]
}
messages · message.bind-parameter-count
{
  "limits": "",
  "message_id": "message.bind-parameter-count",
  "path": "",
  "position": 2,
  "raw": {
    "id": "message.bind-parameter-count",
    "primary_template": "bind message supplies %d parameters, but prepared statement \"%s\" requires %d",
    "severity_source": "explicit ERROR",
    "sources": [
      "src.postgres-bind.10.23"
    ],
    "sqlstate": "08P01"
  },
  "severity": "explicit ERROR",
  "sources": [
    "src.postgres-bind.10.23"
  ],
  "templates": [
    {
      "kind": "primary",
      "literal": "bind message supplies parameters, but prepared statement \" \" requires",
      "position": 0,
      "role": "",
      "template": "bind message supplies %d parameters, but prepared statement \"%s\" requires %d"
    }
  ]
}
messages · message.no-data-left
{
  "limits": "",
  "message_id": "message.no-data-left",
  "path": "",
  "position": 3,
  "raw": {
    "id": "message.no-data-left",
    "primary_template": "no data left in message",
    "severity_source": "explicit ERROR",
    "sources": [
      "src.pqformat.10.23"
    ],
    "sqlstate": "08P01"
  },
  "severity": "explicit ERROR",
  "sources": [
    "src.pqformat.10.23"
  ],
  "templates": [
    {
      "kind": "primary",
      "literal": "no data left in message",
      "position": 0,
      "role": "",
      "template": "no data left in message"
    }
  ]
}
messages · message.insufficient-data-left
{
  "limits": "",
  "message_id": "message.insufficient-data-left",
  "path": "",
  "position": 4,
  "raw": {
    "id": "message.insufficient-data-left",
    "primary_template": "insufficient data left in message",
    "severity_source": "explicit ERROR",
    "sources": [
      "src.pqformat.10.23"
    ],
    "sqlstate": "08P01"
  },
  "severity": "explicit ERROR",
  "sources": [
    "src.pqformat.10.23"
  ],
  "templates": [
    {
      "kind": "primary",
      "literal": "insufficient data left in message",
      "position": 0,
      "role": "",
      "template": "insufficient data left in message"
    }
  ]
}
messages · message.invalid-string
{
  "limits": "",
  "message_id": "message.invalid-string",
  "path": "",
  "position": 5,
  "raw": {
    "id": "message.invalid-string",
    "primary_template": "invalid string in message",
    "severity_source": "explicit ERROR",
    "sources": [
      "src.pqformat.10.23"
    ],
    "sqlstate": "08P01"
  },
  "severity": "explicit ERROR",
  "sources": [
    "src.pqformat.10.23"
  ],
  "templates": [
    {
      "kind": "primary",
      "literal": "invalid string in message",
      "position": 0,
      "role": "",
      "template": "invalid string in message"
    }
  ]
}
messages · message.invalid-format
{
  "limits": "",
  "message_id": "message.invalid-format",
  "path": "",
  "position": 6,
  "raw": {
    "id": "message.invalid-format",
    "primary_template": "invalid message format",
    "severity_source": "explicit ERROR",
    "sources": [
      "src.pqformat.10.23"
    ],
    "sqlstate": "08P01"
  },
  "severity": "explicit ERROR",
  "sources": [
    "src.pqformat.10.23"
  ],
  "templates": [
    {
      "kind": "primary",
      "literal": "invalid message format",
      "position": 0,
      "role": "",
      "template": "invalid message format"
    }
  ]
}
runtimes · runtime.08P01-eof-repair-latest.latest · 18.6 (Homebrew) · passed
{
  "cases": [
    "protocol_violation"
  ],
  "limits": "Disposable runner-owned target only; this is a bounded mechanism case, not a guarantee for every client or network path.",
  "position": 0,
  "raw": {
    "assertions": [
      {
        "expected": "08P01",
        "name": "protocol SQLSTATE comes from server ErrorResponse",
        "observed": "08P01",
        "passed": true
      },
      {
        "expected": "FATAL",
        "name": "protocol violation is fatal",
        "observed": "FATAL",
        "passed": true
      },
      {
        "expected": "invalid frontend message diagnostic",
        "name": "invalid message diagnostic",
        "observed": "invalid frontend message type 89",
        "passed": true
      },
      {
        "expected": true,
        "name": "server closes fatal protocol session",
        "observed": {
          "eof": true,
          "error": null
        },
        "passed": true
      },
      {
        "expected": "ReadyForQuery (Z)",
        "name": "startup reached ReadyForQuery",
        "observed": [
          "R",
          "S",
          "S",
          "S",
          "S",
          "S",
          "S",
          "S",
          "S",
          "S",
          "S",
          "S",
          "S",
          "S",
          "S",
          "S",
          "K",
          "Z"
        ],
        "passed": true
      },
      {
        "expected": "SELECT 1 and IDLE",
        "name": "separate connection remains usable",
        "observed": {
          "probe": 1,
          "status": "IDLE"
        },
        "passed": true
      }
    ],
    "case_manifest": "verify/cases/08P01/cases.json",
    "case_manifest_sha256": "ff8ea1b7c0555be091611aff9149037af8d78ab3abefb82a3954e42b646da437",
    "cases": [
      "protocol_violation"
    ],
    "cleanup": {
      "case": {
        "errors": [],
        "passed": true
      },
      "target_stop": {
        "argv": [
          "/opt/homebrew/Cellar/postgresql@18/18.6/bin/pg_ctl",
          "-D",
          "/Users/vonng/pgcenter/err-code/.cache/runtime/08P01-eof-repair-latest/latest/data",
          "-m",
          "fast",
          "-w",
          "stop"
        ],
        "elapsed_seconds": 0.109,
        "returncode": 0,
        "stderr": "",
        "stdout": "waiting for server to shut down.... done\nserver stopped\n"
      }
    },
    "environment": {
      "lc_messages": "C",
      "libpq_version": "18.6",
      "locale": "en_US.UTF-8",
      "log_destination": "csvlog,jsonlog",
      "machine": "arm64",
      "platform": "macOS-26.6.2-arm64-arm-64bit-Mach-O",
      "psycopg_version": "3.3.5",
      "python_version": "3.14.6 (main, Jun 10 2026, 10:03:53) [Clang 21.0.0 (clang-2100.0.123.102)]",
      "server_version": "18.6 (Homebrew)",
      "server_version_num": "180006",
      "target_kind": "latest"
    },
    "id": "runtime.08P01-eof-repair-latest.latest",
    "kind": "runtime_observation",
    "limits": "Disposable runner-owned target only; this is a bounded mechanism case, not a guarantee for every client or network path.",
    "observed": {
      "collector": {
        "primary": "invalid frontend message type 89",
        "severity": "FATAL",
        "sqlstate": "08P01"
      },
      "connection_scope": "runner-owned TCP endpoint",
      "eof_probe_error": null,
      "invalid_frontend_message_type": "Y",
      "probe": 1,
      "probe_status": "IDLE",
      "server_eof_after_fatal": true,
      "server_error": {
        "C": "08P01",
        "F": "postgres.c",
        "L": "456",
        "M": "invalid frontend message type 89",
        "R": "SocketBackend",
        "S": "FATAL",
        "V": "FATAL"
      },
      "startup_messages": [
        "R",
        "S",
        "S",
        "S",
        "S",
        "S",
        "S",
        "S",
        "S",
        "S",
        "S",
        "S",
        "S",
        "S",
        "S",
        "S",
        "K",
        "Z"
      ]
    },
    "raw": "verify/results/08P01-eof-repair-latest/latest/raw.jsonl",
    "raw_sha256": "6364ec948d1e14121ac160f82f7097d5412eae6f39f434f3a9a87c0f83f37125",
    "run_id": "08P01-eof-repair-latest",
    "server_version": "18.6 (Homebrew)",
    "server_version_num": 180006,
    "snippet_registry": {
      "path": "verify/cases/08P01/snippets.json",
      "sha256": "8fad2a3b728b304d1a81f48779c44eae892da89542ba9fb1a5cb93669bf3e90f"
    },
    "status": "passed",
    "summary": "verify/results/08P01-eof-repair-latest/latest/summary.json",
    "summary_sha256": "092ffb28a00d072464781f159a4046646f4de9fa377c7733d4f0b6d6d36e6f27",
    "target": "latest"
  },
  "run_id": "08P01-eof-repair-latest",
  "runtime_id": "runtime.08P01-eof-repair-latest.latest",
  "server_version": "18.6 (Homebrew)",
  "status": "passed",
  "target": "latest"
}
runtimes · runtime.08P01-eof-repair-pg10.pg10 · 10.21 (Debian 10.21-1.pgdg90+1) · passed
{
  "cases": [
    "protocol_violation"
  ],
  "limits": "Disposable runner-owned target only; this is a bounded mechanism case, not a guarantee for every client or network path.",
  "position": 1,
  "raw": {
    "assertions": [
      {
        "expected": "08P01",
        "name": "protocol SQLSTATE comes from server ErrorResponse",
        "observed": "08P01",
        "passed": true
      },
      {
        "expected": "FATAL",
        "name": "protocol violation is fatal",
        "observed": "FATAL",
        "passed": true
      },
      {
        "expected": "invalid frontend message diagnostic",
        "name": "invalid message diagnostic",
        "observed": "invalid frontend message type 89",
        "passed": true
      },
      {
        "expected": true,
        "name": "server closes fatal protocol session",
        "observed": {
          "eof": true,
          "error": null
        },
        "passed": true
      },
      {
        "expected": "ReadyForQuery (Z)",
        "name": "startup reached ReadyForQuery",
        "observed": [
          "R",
          "S",
          "S",
          "S",
          "S",
          "S",
          "S",
          "S",
          "S",
          "S",
          "S",
          "S",
          "K",
          "Z"
        ],
        "passed": true
      },
      {
        "expected": "SELECT 1 and IDLE",
        "name": "separate connection remains usable",
        "observed": {
          "probe": 1,
          "status": "IDLE"
        },
        "passed": true
      }
    ],
    "case_manifest": "verify/cases/08P01/cases.json",
    "case_manifest_sha256": "ff8ea1b7c0555be091611aff9149037af8d78ab3abefb82a3954e42b646da437",
    "cases": [
      "protocol_violation"
    ],
    "cleanup": {
      "case": {
        "errors": [],
        "passed": true
      },
      "target_stop": {
        "cleanup": {
          "argv": [
            "/usr/local/bin/docker",
            "rm",
            "-f",
            "-v",
            "sqlstate08p01_08P01eofrepairpg10_pg10"
          ],
          "elapsed_seconds": 0.317,
          "returncode": 0,
          "stderr": "",
          "stdout": "sqlstate08p01_08P01eofrepairpg10_pg10\n"
        },
        "inspect": {
          "argv": [
            "/usr/local/bin/docker",
            "inspect",
            "sqlstate08p01_08P01eofrepairpg10_pg10"
          ],
          "elapsed_seconds": 0.02,
          "returncode": 0,
          "stderr": "",
          "stdout": "[\n    {\n        \"Id\": \"26fd4f6f5fa521c9e057e2aaaf9f5c8aaf1940a30ae41fc1f312e8e691d3f185\",\n        \"Created\": \"2026-09-09T15:32:56.548369298Z\",\n        \"Path\": \"docker-entrypoint.sh\",\n        \"Args\": [\n            \"postgres\",\n            \"-c\",\n            \"listen_addresses=*\",\n            \"-c\",\n            \"log_destination=csvlog\",\n            \"-c\",\n            \"logging_collector=on\",\n            \"-c\",\n            \"log_directory=log\",\n            \"-c\",\n            \"log_filename=postgresql-%Y%m%d%H%M%S.log\",\n            \"-c\",\n            \"log_min_messages=error\",\n            \"-c\",\n            \"log_min_error_statement=error\",\n            \"-c\",\n            \"log_error_verbosity=verbose\",\n            \"-c\",\n            \"wal_level=logical\",\n            \"-c\",\n            \"max_wal_senders=10\",\n            \"-c\",\n            \"max_replication_slots=10\"\n        ],\n        \"State\": {\n            \"Status\": \"running\",\n            \"Running\": true,\n            \"Paused\": false,\n            \"Restarting\": false,\n            \"OOMKilled\": false,\n            \"Dead\": false,\n            \"Pid\": 56640,\n            \"ExitCode\": 0,\n            \"Error\": \"\",\n            \"StartedAt\": \"2026-09-09T15:32:56.660443964Z\",\n            \"FinishedAt\": \"0001-01-01T00:00:00Z\"\n        },\n        \"Image\": \"sha256:b2baf8998630663d21370da06387c950e587071bdd307ee34e661cdcc7442bcc\",\n        \"ResolvConfPath\": \"/var/lib/docker/containers/26fd4f6f5fa521c9e057e2aaaf9f5c8aaf1940a30ae41fc1f312e8e691d3f185/resolv.conf\",\n        \"HostnamePath\": \"/var/lib/docker/containers/26fd4f6f5fa521c9e057e2aaaf9f5c8aaf1940a30ae41fc1f312e8e691d3f185/hostname\",\n        \"HostsPath\": \"/var/lib/docker/containers/26fd4f6f5fa521c9e057e2aaaf9f5c8aaf1940a30ae41fc1f312e8e691d3f185/hosts\",\n        \"LogPath\": \"/var/lib/docker/containers/26fd4f6f5fa521c9e057e2aaaf9f5c8aaf1940a30ae41fc1f312e8e691d3f185/26fd4f6f5fa521c9e057e2aaaf9f5c8aaf1940a30ae41fc1f312e8e691d3f185-json.log\",\n        \"Name\": \"/sqlstate08p01_08P01eofrepairpg10_pg10\",\n        \"RestartCount\": 0,\n        \"Driver\": \"overlayfs\",\n        \"Platform\": \"linux\",\n        \"MountLabel\": \"\",\n        \"ProcessLabel\": \"\",\n        \"AppArmorProfile\": \"\",\n        \"ExecIDs\": null,\n        \"HostConfig\": {\n            \"Binds\": null,\n            \"ContainerIDFile\": \"\",\n            \"LogConfig\": {\n                \"Type\": \"json-file\",\n                \"Config\": {}\n            },\n            \"NetworkMode\": \"bridge\",\n            \"PortBindings\": {\n                \"5432/tcp\": [\n                    {\n                        \"HostIp\": \"127.0.0.1\",\n                        \"HostPort\": \"\"\n                    }\n                ]\n            },\n            \"RestartPolicy\": {\n                \"Name\": \"no\",\n                \"MaximumRetryCount\": 0\n            },\n            \"AutoRemove\": false,\n            \"VolumeDriver\": \"\",\n            \"VolumesFrom\": null,\n            \"ConsoleSize\": [\n                0,\n                0\n            ],\n            \"CapAdd\": null,\n            \"CapDrop\": null,\n            \"CgroupnsMode\": \"private\",\n            \"Dns\": null,\n            \"DnsOptions\": [],\n            \"DnsSearch\": [],\n            \"ExtraHosts\": null,\n            \"GroupAdd\": null,\n            \"IpcMode\": \"private\",\n            \"Cgroup\": \"\",\n            \"Links\": null,\n            \"OomScoreAdj\": 0,\n            \"PidMode\": \"\",\n            \"Privileged\": false,\n            \"PublishAllPorts\": false,\n            \"ReadonlyRootfs\": false,\n            \"SecurityOpt\": null,\n            \"UTSMode\": \"\",\n            \"UsernsMode\": \"\",\n            \"ShmSize\": 67108864,\n            \"Runtime\": \"runc\",\n            \"Isolation\": \"\",\n            \"CpuShares\": 0,\n            \"Memory\": 0,\n            \"NanoCpus\": 0,\n            \"CgroupParent\": \"\",\n            \"BlkioWeight\": 0,\n            \"BlkioWeightDevice\": [],\n            \"BlkioDeviceReadBps\": [],\n            \"BlkioDeviceWriteBps\": [],\n            \"BlkioDeviceReadIOps\": [],\n            \"BlkioDeviceWriteIOps\": [],\n            \"CpuPeriod\": 0,\n            \"CpuQuota\": 0,\n            \"CpuRealtimePeriod\": 0,\n            \"CpuRealtimeRuntime\": 0,\n            \"CpusetCpus\": \"\",\n            \"CpusetMems\": \"\",\n            \"Devices\": [],\n            \"DeviceCgroupRules\": null,\n            \"DeviceRequests\": null,\n            \"MemoryReservation\": 0,\n            \"MemorySwap\": 0,\n            \"MemorySwappiness\": null,\n            \"OomKillDisable\": null,\n            \"PidsLimit\": null,\n            \"Ulimits\": [],\n            \"CpuCount\": 0,\n            \"CpuPercent\": 0,\n            \"IOMaximumIOps\": 0,\n            \"IOMaximumBandwidth\": 0,\n            \"MaskedPaths\": [\n                \"/proc/acpi\",\n                \"/proc/asound\",\n                \"/proc/interrupts\",\n                \"/proc/kcore\",\n                \"/proc/keys\",\n                \"/proc/latency_stats\",\n                \"/proc/sched_debug\",\n                \"/proc/scsi\",\n                \"/proc/timer_list\",\n                \"/proc/timer_stats\",\n                \"/sys/devices/virtual/powercap\",\n                \"/sys/firmware\"\n            ],\n            \"ReadonlyPaths\": [\n                \"/proc/bus\",\n                \"/proc/fs\",\n                \"/proc/irq\",\n                \"/proc/sys\",\n                \"/proc/sysrq-trigger\"\n            ]\n        },\n        \"Storage\": {\n            \"RootFS\": {\n                \"Snapshot\": {\n                    \"Name\": \"overlayfs\"\n                }\n            }\n        },\n        \"Mounts\": [\n            {\n                \"Type\": \"volume\",\n                \"Name\": \"7a91f8bb39ab938c0c655ad9fe3959dd66f9ee7aa58d7da0358feeb34418609a\",\n                \"Source\": \"/var/lib/docker/volumes/7a91f8bb39ab938c0c655ad9fe3959dd66f9ee7aa58d7da0358feeb34418609a/_data\",\n                \"Destination\": \"/var/lib/postgresql/data\",\n                \"Driver\": \"local\",\n                \"Mode\": \"\",\n                \"RW\": true,\n                \"Propagation\": \"\"\n            }\n        ],\n        \"Config\": {\n            \"Hostname\": \"26fd4f6f5fa5\",\n            \"Domainname\": \"\",\n            \"User\": \"\",\n            \"AttachStdin\": false,\n            \"AttachStdout\": false,\n            \"AttachStderr\": false,\n            \"ExposedPorts\": {\n                \"5432/tcp\": {}\n            },\n            \"Tty\": false,\n            \"OpenStdin\": false,\n            \"StdinOnce\": false,\n            \"Env\": [\n                \"POSTGRES_HOST_AUTH_METHOD=trust\",\n                \"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/postgresql/10/bin\",\n                \"GOSU_VERSION=1.14\",\n                \"LANG=en_US.utf8\",\n                \"PG_MAJOR=10\",\n                \"PG_VERSION=10.21-1.pgdg90+1\",\n                \"PGDATA=/var/lib/postgresql/data\"\n            ],\n            \"Cmd\": [\n                \"postgres\",\n                \"-c\",\n                \"listen_addresses=*\",\n                \"-c\",\n                \"log_destination=csvlog\",\n                \"-c\",\n                \"logging_collector=on\",\n                \"-c\",\n                \"log_directory=log\",\n                \"-c\",\n                \"log_filename=postgresql-%Y%m%d%H%M%S.log\",\n                \"-c\",\n                \"log_min_messages=error\",\n                \"-c\",\n                \"log_min_error_statement=error\",\n                \"-c\",\n                \"log_error_verbosity=verbose\",\n                \"-c\",\n                \"wal_level=logical\",\n                \"-c\",\n                \"max_wal_senders=10\",\n                \"-c\",\n                \"max_replication_slots=10\"\n            ],\n            \"Image\": \"postgres@sha256:b2baf8998630663d21370da06387c950e587071bdd307ee34e661cdcc7442bcc\",\n            \"Volumes\": {\n                \"/var/lib/postgresql/data\": {}\n            },\n            \"WorkingDir\": \"\",\n            \"Entrypoint\": [\n                \"docker-entrypoint.sh\"\n            ],\n            \"Labels\": {},\n            \"StopSignal\": \"SIGINT\",\n            \"StopTimeout\": 1\n        },\n        \"NetworkSettings\": {\n            \"SandboxID\": \"15aef53e12f50f8cb7311b8968993281a1c00e34b197e7860bb21db3082f251e\",\n            \"SandboxKey\": \"/var/run/docker/netns/15aef53e12f5\",\n            \"Ports\": {\n                \"5432/tcp\": [\n                    {\n                        \"HostIp\": \"127.0.0.1\",\n                        \"HostPort\": \"62073\"\n                    }\n                ]\n            },\n            \"Networks\": {\n                \"bridge\": {\n                    \"IPAMConfig\": null,\n                    \"Links\": null,\n                    \"Aliases\": null,\n                    \"DriverOpts\": null,\n                    \"GwPriority\": 0,\n                    \"NetworkID\": \"aed51554f8cd8bac69ecd4f073e41e147fda7b458e9d95be2af472651f2e825c\",\n                    \"EndpointID\": \"73dc3d9a216090ba58ff15d32e0e17496d91344244d84273330fa49e58768e58\",\n                    \"Gateway\": \"172.17.0.1\",\n                    \"IPAddress\": \"172.17.0.53\",\n                    \"MacAddress\": \"9e:2f:95:27:05:56\",\n                    \"IPPrefixLen\": 16,\n                    \"IPv6Gateway\": \"\",\n                    \"GlobalIPv6Address\": \"\",\n                    \"GlobalIPv6PrefixLen\": 0,\n                    \"DNSNames\": null\n                }\n            }\n        },\n        \"ImageManifestDescriptor\": {\n            \"mediaType\": \"application/vnd.docker.distribution.manifest.v2+json\",\n            \"digest\": \"sha256:52aada7978f1eef3b6b52a51afb7a3defd69254d00c946cb90d2ceb32b8ffce7\",\n            \"size\": 3246,\n            \"platform\": {\n                \"architecture\": \"arm64\",\n                \"os\": \"linux\",\n                \"variant\": \"v8\"\n            }\n        }\n    }\n]\n"
        }
      }
    },
    "environment": {
      "lc_messages": "en_US.utf8",
      "libpq_version": "18.6",
      "locale": "en_US.UTF-8",
      "log_destination": "csvlog",
      "machine": "arm64",
      "platform": "macOS-26.6.2-arm64-arm-64bit-Mach-O",
      "psycopg_version": "3.3.5",
      "python_version": "3.14.6 (main, Jun 10 2026, 10:03:53) [Clang 21.0.0 (clang-2100.0.123.102)]",
      "server_version": "10.21 (Debian 10.21-1.pgdg90+1)",
      "server_version_num": "100021",
      "target_kind": "pg10"
    },
    "id": "runtime.08P01-eof-repair-pg10.pg10",
    "image": "postgres:10",
    "kind": "runtime_observation",
    "limits": "Disposable runner-owned target only; this is a bounded mechanism case, not a guarantee for every client or network path.",
    "observed": {
      "collector": {
        "primary": "invalid frontend message type 89",
        "severity": "FATAL",
        "sqlstate": "08P01"
      },
      "connection_scope": "runner-owned TCP endpoint",
      "eof_probe_error": null,
      "invalid_frontend_message_type": "Y",
      "probe": 1,
      "probe_status": "IDLE",
      "server_eof_after_fatal": true,
      "server_error": {
        "C": "08P01",
        "F": "postgres.c",
        "L": "467",
        "M": "invalid frontend message type 89",
        "R": "SocketBackend",
        "S": "FATAL",
        "V": "FATAL"
      },
      "startup_messages": [
        "R",
        "S",
        "S",
        "S",
        "S",
        "S",
        "S",
        "S",
        "S",
        "S",
        "S",
        "S",
        "K",
        "Z"
      ]
    },
    "raw": "verify/results/08P01-eof-repair-pg10/pg10/raw.jsonl",
    "raw_sha256": "52ac4143e18bbc2fc2d8af0dbcb4d14ad54e8519fbdaa351e50b99aeb50f563d",
    "run_id": "08P01-eof-repair-pg10",
    "server_version": "10.21 (Debian 10.21-1.pgdg90+1)",
    "server_version_num": 100021,
    "snippet_registry": {
      "path": "verify/cases/08P01/snippets.json",
      "sha256": "8fad2a3b728b304d1a81f48779c44eae892da89542ba9fb1a5cb93669bf3e90f"
    },
    "status": "passed",
    "summary": "verify/results/08P01-eof-repair-pg10/pg10/summary.json",
    "summary_sha256": "91736dfcfbf3d47205388295113f747c2e0693e844f90bcf9937e5adc530266c",
    "target": "pg10"
  },
  "run_id": "08P01-eof-repair-pg10",
  "runtime_id": "runtime.08P01-eof-repair-pg10.pg10",
  "server_version": "10.21 (Debian 10.21-1.pgdg90+1)",
  "status": "passed",
  "target": "pg10"
}
sources · src.errcodes.18.6
{
  "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
  "docs_url": "",
  "kind": "upstream_source",
  "location": "",
  "path": "src/backend/utils/errcodes.txt",
  "position": 0,
  "sha256": "6e8de346643ba84aa3c9c6a73360acfc7b2dfb89162c06c08ce9bf5bcd5bbcba",
  "source_id": "src.errcodes.18.6",
  "tag": "REL_18_6",
  "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/errcodes.txt"
}
sources · src.calls.REL_18_6
{
  "commit": "",
  "docs_url": "",
  "kind": "local_artifact",
  "location": "",
  "path": "raw/calls/REL_18_6.jsonl",
  "position": 1,
  "sha256": "9ee8a0e81d8f0825c5c1ae45583439859a26e602bdd4ce2f2a62aa278867ccbf",
  "source_id": "src.calls.REL_18_6",
  "tag": "REL_18_6",
  "url": ""
}
sources · src.calls.REL_10_23
{
  "commit": "",
  "docs_url": "",
  "kind": "local_artifact",
  "location": "",
  "path": "raw/calls/REL_10_23.jsonl",
  "position": 2,
  "sha256": "00d16d3eb01b71ccf1b245c8f3102f9d0ec9f36fb02777b8dd1b99fcb263040c",
  "source_id": "src.calls.REL_10_23",
  "tag": "REL_10_23",
  "url": ""
}
sources · src.protocol-invalid-frontend.18.6
{
  "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
  "docs_url": "",
  "kind": "upstream_source",
  "location": "",
  "path": "src/backend/tcop/postgres.c",
  "position": 3,
  "sha256": "9fb62275b1badf94d01ab351337b60410cd9b3ab1fe63fa9f23d6d2185a21061",
  "source_id": "src.protocol-invalid-frontend.18.6",
  "tag": "REL_18_6",
  "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/tcop/postgres.c#L454-L456"
}
sources · src.protocol-invalid-frontend.10.23
{
  "commit": "02991e79f8f58bc208f05dcc8af0c62dbe0a6ea4",
  "docs_url": "",
  "kind": "upstream_source",
  "location": "",
  "path": "src/backend/tcop/postgres.c",
  "position": 4,
  "sha256": "badfe30749794afa80a799dcdbd142fd4e4732ac1c913002d365549ae5313497",
  "source_id": "src.protocol-invalid-frontend.10.23",
  "tag": "REL_10_23",
  "url": "https://github.com/postgres/postgres/blob/02991e79f8f58bc208f05dcc8af0c62dbe0a6ea4/src/backend/tcop/postgres.c#L430-L432"
}
sources · src.postgres-bind.10.23
{
  "commit": "02991e79f8f58bc208f05dcc8af0c62dbe0a6ea4",
  "docs_url": "",
  "kind": "upstream_source",
  "location": "",
  "path": "src/backend/tcop/postgres.c",
  "position": 5,
  "sha256": "badfe30749794afa80a799dcdbd142fd4e4732ac1c913002d365549ae5313497",
  "source_id": "src.postgres-bind.10.23",
  "tag": "REL_10_23",
  "url": "https://github.com/postgres/postgres/blob/02991e79f8f58bc208f05dcc8af0c62dbe0a6ea4/src/backend/tcop/postgres.c#L1483-L1580"
}
sources · src.pqformat.10.23
{
  "commit": "02991e79f8f58bc208f05dcc8af0c62dbe0a6ea4",
  "docs_url": "",
  "kind": "upstream_source",
  "location": "",
  "path": "src/backend/libpq/pqformat.c",
  "position": 6,
  "sha256": "637923dbf2b9d9a0610350784f3b1d7d36a545cd8a6bd2cbe6272d9549873a91",
  "source_id": "src.pqformat.10.23",
  "tag": "REL_10_23",
  "url": "https://github.com/postgres/postgres/blob/02991e79f8f58bc208f05dcc8af0c62dbe0a6ea4/src/backend/libpq/pqformat.c#L432-L682"
}
sources · src.postgres-sync.10.23
{
  "commit": "02991e79f8f58bc208f05dcc8af0c62dbe0a6ea4",
  "docs_url": "",
  "kind": "upstream_source",
  "location": "",
  "path": "src/backend/tcop/postgres.c",
  "position": 7,
  "sha256": "badfe30749794afa80a799dcdbd142fd4e4732ac1c913002d365549ae5313497",
  "source_id": "src.postgres-sync.10.23",
  "tag": "REL_10_23",
  "url": "https://github.com/postgres/postgres/blob/02991e79f8f58bc208f05dcc8af0c62dbe0a6ea4/src/backend/tcop/postgres.c#L3863-L3980"
}
sources · doc.protocol.18
{
  "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
  "docs_url": "",
  "kind": "upstream_source",
  "location": "",
  "path": "doc/src/sgml/protocol.sgml",
  "position": 8,
  "sha256": "745339e07ebbc2bb67d98b258e25772ada644ef26011e3cd6b3fcbb435235f89",
  "source_id": "doc.protocol.18",
  "tag": "PG18-docs",
  "url": "https://www.postgresql.org/docs/18/protocol-error-fields.html"
}
sources · manifest.08P01
{
  "commit": "",
  "docs_url": "",
  "kind": "local_artifact",
  "location": "",
  "path": "verify/cases/08P01/cases.json",
  "position": 9,
  "sha256": "ff8ea1b7c0555be091611aff9149037af8d78ab3abefb82a3954e42b646da437",
  "source_id": "manifest.08P01",
  "tag": "workspace",
  "url": "verify/cases/08P01/cases.json"
}
sources · snippet-registry.08P01
{
  "commit": "",
  "docs_url": "",
  "kind": "local_artifact",
  "location": "",
  "path": "verify/cases/08P01/snippets.json",
  "position": 10,
  "sha256": "8fad2a3b728b304d1a81f48779c44eae892da89542ba9fb1a5cb93669bf3e90f",
  "source_id": "snippet-registry.08P01",
  "tag": "workspace",
  "url": "verify/cases/08P01/snippets.json"
}

来源引用

完整定义与证据 JSON

定义来源

center · PostgreSQL 18 · english-manuals:cff3edb58e3a5379935f38c2fa5b82c967b8abd9d6a2f638625ec62be8b27d48

正文语言: zh-Hans · english-manuals:cff3edb58e3a5379935f38c2fa5b82c967b8abd9d6a2f638625ec62be8b27d48