百科 / 错误代码 / Class 02 无数据
02000 no_data
WARNING 源码确认 参考 未实测
- 条件名
no_data- 宏名称
ERRCODE_NO_DATA- 启用版本
- 7.4
- 状态
- 活跃
版本覆盖
速览
02000 在 18.6 的 contrib/amcheck/verify_nbtree.c 中有确认的 DEBUG1/DEBUG2 内部索引检查路径。下面详列的三个组都确认是 DEBUG1;这些诊断不同于普通查询无行,也不是通用客户端错误。
含义
确认的 18.6 实现位于 contrib/amcheck/verify_nbtree.c,索引一致性诊断在 DEBUG1 或 DEBUG2 使用 ERRCODE_NO_DATA。这是内部诊断用途,不是普通 SELECT 无行语义。本证据具体展开三个代表性组;源码中的其他路径不在这组选定消息内。
消息与诊断
本次选定的固定消息组为:
DEBUG1、内部errmsg_internal:harmless fast root mismatch in index "%s",内部 detail 为Fast root block %u (level %u) differs from true root block %u (level %u).。源码明确把它标为 harmless。DEBUG1、内部errmsg_internal:block %u of index "%s" concurrently deleted。这个分支的确认组没有 detail 或 hint。DEBUG1、普通errmsg/errdetail/errhint:index uniqueness can not be checked for index tid=(%u,%u) in index "%s",detail 为It doesn't have visible heap tids and key is equal to the tid=(%u,%u)%s (points to heap tid=(%u,%u)).,hint 为VACUUM the table and repeat the check.。VACUUM hint 只属于这个组。
报文模板
源码里的格式串,不是某一次运行的输出。%s 之类是占位符,实际报文会填入对象名与取值。适用范围一栏是核验时留下的原始英文记录,未经翻译。
harmless fast root mismatch in index "%s"
Fast root block %u (level %u) differs from true root block %u (level %u).
来源:contrib/amcheck/verify_nbtree.c @ REL_18_6
适用范围:Resolved group is DEBUG1 and internal; the fixed source labels this mismatch harmless, so it does not imply corruption or a VACUUM requirement.
block %u of index "%s" concurrently deleted
来源:contrib/amcheck/verify_nbtree.c @ REL_18_6
适用范围:Resolved group is DEBUG1 and internal; this branch has no VACUUM hint and requires concurrency context.
index uniqueness can not be checked for index tid=(%u,%u) in index "%s"
It doesn't have visible heap tids and key is equal to the tid=(%u,%u)%s (points to heap tid=(%u,%u)).
VACUUM the table and repeat the check.
来源:contrib/amcheck/verify_nbtree.c @ REL_18_6
适用范围:Resolved group is DEBUG1; the VACUUM hint belongs to this uniqueness-check branch only.
诊断
若代码来自 amcheck,记录检查、索引、block/TID 上下文和服务器日志严重级别。fast-root mismatch 已被源码标为 harmless,应结合上下文记录,不要自动当作损坏修复。对于并发删除,应关联并发操作或快照,待相关活动稳定后再决定是否重跑。对于 uniqueness-uncheckable 组,应检查指定索引,并只在该组给出提示时执行 VACUUM 后重跑。应用无行处理应检查实际命令结果或过程条件;PL/pgSQL 的 NO_DATA_FOUND 是 P0002,不是 02000 的通用同义词。
处理
按分支处理:不要把 harmless fast-root 诊断自动变成修复;并发删除要调查并发状态;只有 uniqueness-uncheckable 组给出该提示时,才先执行 VACUUM 再重跑。不要要求每个 DEBUG 发现都做维护,也不要仅因 SQLSTATE 属于 02 类就给普通 SELECT 加无行异常或重试。
版本
02000 在锁定目录 9.0.23 至 18.6 以及 19 Beta 3 中存在,known_present_by 为 7.4。18.6 证据覆盖 amcheck DEBUG 路径;其他来源需要独立源码证据。
来源
证据
断言
每条断言都写明了是怎么核实的,以及它不覆盖什么。这一层是核验时留下的原始英文记录,照原样呈现,未经翻译。
-
02000 is no_data in SQLSTATE Class 02.
-
A fixed PostgreSQL 18.6 source path uses this SQLSTATE at the stated severity and operation.
-
The authored evidence expands three representative amcheck groups, each resolved at DEBUG1; the fixed source also contains other 02000 DEBUG1/DEBUG2 paths that are outside this selected message set.
同类错误代码
Class 02 无数据 下的其他成员。