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

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

Wiki / SQLSTATE

39004 — null_value_not_allowed

外部例程调用中不允许出现 NULL 值。

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

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

aliases
未知
class name
External Routine Invocation Exception
condition name
null_value_not_allowed
lang
en
sqlstate
39004

版本定义 PG 18

39004

速览 {#at-a-glance}

39004 是 SQL Routine Exception 类中的 null_value_not_allowed。本页只根据固定定义和有界源码扫描说明定位方法,不把条件名扩展成未经证实的具体调用。

含义 {#meaning}

它表示某个 routine、扩展或其调用边界拒绝了不允许的 NULL。固定 PostgreSQL 18.6 调用归档没有解析出该条件的报告路径,因此不能仅凭 SQLSTATE 判断是参数、返回值、触发器还是其他 routine 约束。

诊断 {#diagnosis}

先保存完整 ErrorResponse 的 message、detail、hint、schema、table、column、routine 与位置字段,再按实际 routine 或扩展实现搜索 ERRCODE_E_R_I_E_NULL_VALUE_NOT_ALLOWED。若代码来自客户端封装或扩展,要检查它实际选择的 SQLSTATE;本页的有界扫描不能替代对部署版本的 wrapper 源码检查。

处置 {#response}

修正诊断中指明的 NULL 输入或 routine 契约,并重新核对调用方与实现方的边界。没有具体报告该码的路径时,不要凭条件名改事务策略、盲目重试或声称某个 SQL 语句必然触发它。

版本 {#versions}

锁定目录从 7.4 记录该条件,并在列出的正式快照及 19beta3 中出现;这只是定义存在边界,未确认精确引入实现。

相关条件 {#related}

39000, 39P01

来源 {#sources}

详见结构化的证据记录,其中列出固定源码链接、消息模板与范围限制。

比较版本

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

claims · identity
{
  "claim_id": "identity",
  "limits": "",
  "method": "Read the fixed errcodes row and macro.",
  "position": 0,
  "runtime": [],
  "sources": [
    "src.errcodes.18.6"
  ],
  "statement": "39004 is null_value_not_allowed, a SQL Routine Exception condition defined in Class 39."
}
claims · bounded-scan
{
  "claim_id": "bounded-scan",
  "limits": "This is a bounded archive result, not proof that no extension, wrapper, or older/newer source can emit it.",
  "method": "Filter the archive by code and inspect concrete report groups.",
  "position": 1,
  "runtime": [],
  "sources": [
    "src.calls.REL_18_6"
  ],
  "statement": "The fixed REL_18_6 call archive contains no resolved report group for 39004."
}
claims · history
{
  "claim_id": "history",
  "limits": "Definition presence does not identify the operation that rejected the NULL.",
  "method": "Use catalogue presence and history boundaries.",
  "position": 2,
  "runtime": [],
  "sources": [
    "src.errcodes.18.6"
  ],
  "statement": "The locked catalogue records the condition from 7.4 and in the listed release snapshots, without identifying an introducing implementation."
}
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#L310"
}
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": "",
  "url": ""
}

来源引用

完整定义与证据 JSON

定义来源

center · PostgreSQL 18 · english-manuals:d6accfa9aafff9f213830ea138272be864c007ed84dfb49ade0b11dd6616d24e

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