选择 打开 改范围 完整检索页

pgsql.cc 提供对 postgresql.org 官网内容的中文翻译,由 Pigsty 团队维护。

文档 / SQL 状态码 / Class 02 无数据

02000 no_data

WARNING 源码确认 参考 未实测

类别
Class 02 无数据
严重等级
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,索引一致性诊断在 DEBUG1DEBUG2 使用 ERRCODE_NO_DATA。这是内部诊断用途,不是普通 SELECT 无行语义。本证据具体展开三个代表性组;源码中的其他路径不在这组选定消息内。

消息与诊断

本次选定的固定消息组为:

  • DEBUG1、内部 errmsg_internalharmless fast root mismatch in index "%s",内部 detail 为 Fast root block %u (level %u) differs from true root block %u (level %u).。源码明确把它标为 harmless。
  • DEBUG1、内部 errmsg_internalblock %u of index "%s" concurrently deleted。这个分支的确认组没有 detail 或 hint。
  • DEBUG1、普通 errmsg/errdetail/errhintindex 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"
DETAIL 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"
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.

来源: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_FOUNDP0002,不是 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.

    核实方式Read the fixed errcodes definition row and macro.

    来源src/backend/utils/errcodes.txt

  • A fixed PostgreSQL 18.6 source path uses this SQLSTATE at the stated severity and operation.

    核实方式Read the fixed source context around the SQLSTATE macro.

    不覆盖This confirms a source path and current wording; it is not a runtime observation of every installation.

    来源contrib/amcheck/verify_nbtree.c

  • 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.

    核实方式Compare the selected message groups with the fixed verify_nbtree.c call scan.

    不覆盖No natural amcheck runtime or exhaustive producer inventory is claimed.

    来源contrib/amcheck/verify_nbtree.c

同类 SQL 状态码

状态码 条件名 宏名称 严重等级 版本
Class 02 无数据 No Data (this is also a warning class per the SQL standard) 2 个
02000 no_data ERRCODE_NO_DATA WARNING 7.4
无数据条件,不等同于查询返回零行。 活跃
02001 no_additional_dynamic_result_sets_returned ERRCODE_NO_ADDITIONAL_DYNAMIC_RESULT_SETS_RETURNED WARNING 7.4
没有更多动态结果集可返回。 活跃