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

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

百科 / 错误代码 / Class P0 PL/pgSQL错误

P0000 plpgsql_error

ERROR 仅定义 参考 未实测

类别
Class P0 PL/pgSQL错误
严重等级
ERROR
条件名
plpgsql_error
宏名称
ERRCODE_PLPGSQL_ERROR
启用版本
8.0
状态
活跃

版本覆盖

速览

P0000 是 PostgreSQL 专用 plpgsql_error 类别项。固定 18.6 调用归档没有解析出该类别码本身的报告路径,因此不能把成员码的行为倒推成 P0000 发出的错误。

含义

它表示 PL/pgSQL Error 类别的目录身份。实际执行路径可能选择更具体的成员 SQLSTATE,例如 P0002P0003P0004;类别定义和成员实现不能互相替代。

诊断

以客户端或日志中实际收到的 SQLSTATE 为准,再按该码检查 PL/pgSQL 的执行上下文。若只知道错误来自 PL/pgSQL 而没有 SQLSTATE,应保留完整诊断字段,并检查部署版本和自定义代码,而不是直接归类为 P0000。

处置

根据实际成员码修正对应的 PL/pgSQL 语句、函数契约或异常处理。只有定义层面的 P0000 信息时,无法给出更窄的 SQL 操作建议;应继续定位实际报告路径。

版本

锁定目录从 8.0.0 记录该类别项,并在列出的正式快照及 19beta3 中出现;有界源码扫描未确认其自然报告路径。

来源

证据

断言

每条断言都写明了是怎么核实的,以及它不覆盖什么。这一层是核验时留下的原始英文记录,照原样呈现,未经翻译。

  • P0000 is plpgsql_error, the PostgreSQL-specific PL/pgSQL Error category entry.

    核实方式Read the fixed category row and macro.

    来源src/backend/utils/errcodes.txt

  • The fixed REL_18_6 call archive has no resolved report group for the P0000 category code.

    核实方式Filter the archive by exact code and do not promote member-code reports to a category emitter.

    不覆盖A category definition does not imply that executor paths emit the category code itself.

    来源raw/calls/REL_18_6.jsonl

  • Specific PL/pgSQL conditions such as P0002, P0003, and P0004 have their own report paths and should be diagnosed by their actual SQLSTATE.

    核实方式Compare the category row with member definitions.

    来源src/backend/utils/errcodes.txt

同类错误代码

Class P0 PL/pgSQL错误 下的其他成员。