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

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

Wiki / SQLSTATE

2F005 — function_executed_no_return_statement

函数执行结束时没有执行 RETURN 语句。

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

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

aliases
未知
class name
SQL Routine Exception
condition name
function_executed_no_return_statement
lang
en
sqlstate
2F005

版本定义 PG 18

2F005

速览 {#at-a-glance}

SQLSTATE 2F005 是 SQL Routine Exception 类别中“函数执行时缺少 RETURN”的成员。固定的 PostgreSQL 18.6 PL/pgSQL 路径区分普通函数和触发器过程的消息。

含义 {#meaning}

确认的消息是 control reached end of function without RETURN 和 control reached end of trigger procedure without RETURN。返回要求取决于例程种类和声明的返回行为;这不是笼统的“函数返回 NULL”消息。

消息 {#messages}

确认的消息是 control reached end of function without RETURN 和 control reached end of trigger procedure without RETURN。返回要求取决于例程种类和声明的返回行为;这不是笼统的“函数返回 NULL”消息。

诊断 {#diagnosis}

读取例程签名以及所有可能到达末尾的控制流。对于触发器过程,按触发器契约检查每个应返回触发器行或 NULL 的分支;对于返回值函数,检查每个分支是否都有兼容的 RETURN。

处理 {#response}

增加所需的返回路径,并在重做操作前验证例程定义。这是例程控制流修复;只有考虑过外层操作是否已经产生可见工作后,才决定重试。

版本 {#versions}

锁定目录将该条件的已知下界记为 PostgreSQL 7.4;事实块列出已发布快照,源码路径状态仅限于下方固定的 PostgreSQL 18.6 资料。

相关 {#related}

2F000, 38000

来源 {#sources}

详见结构化证据记录,其中记录固定源码路径、扫描范围和未解决的运行边界。

比较版本

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

claims · identity
{
  "claim_id": "identity",
  "limits": "",
  "method": "Read the fixed errcodes definition row, severity, and macro.",
  "position": 0,
  "runtime": [],
  "sources": [
    "src.errcodes.18.6"
  ],
  "statement": "2F005 is function_executed_no_return_statement in SQLSTATE Class 2F."
}
claims · resolved-path
{
  "claim_id": "resolved-path",
  "limits": "Source confirmation is not a runtime observation in this batch.",
  "method": "Read the complete source context around the resolved report groups.",
  "position": 1,
  "runtime": [],
  "sources": [
    "src.path.0"
  ],
  "statement": "The fixed PostgreSQL 18.6 source contains the report contexts and message variants described on the page."
}
claims · history-boundary
{
  "claim_id": "history-boundary",
  "limits": "Definition presence is not an emitting-path observation.",
  "method": "Compare canonical release facts with the available history boundary.",
  "position": 2,
  "runtime": [],
  "sources": [
    "src.errcodes.18.6"
  ],
  "statement": "Locked release definitions establish catalogue presence from 7.4; they do not establish a precise introducing release or runtime use."
}
messages · message.plpgsql-function-no-return
{
  "limits": "",
  "message_id": "message.plpgsql-function-no-return",
  "path": "",
  "position": 0,
  "raw": {
    "id": "message.plpgsql-function-no-return",
    "primary_template": "control reached end of function without RETURN",
    "severity_source": "ERROR",
    "sources": [
      "src.path.0"
    ],
    "sqlstate": "2F005"
  },
  "severity": "ERROR",
  "sources": [
    "src.path.0"
  ],
  "templates": [
    {
      "kind": "primary",
      "literal": "control reached end of function without RETURN",
      "position": 0,
      "role": "",
      "template": "control reached end of function without RETURN"
    }
  ]
}
messages · message.plpgsql-trigger-no-return
{
  "limits": "The same trigger template appears at more than one fixed control-flow path.",
  "message_id": "message.plpgsql-trigger-no-return",
  "path": "",
  "position": 1,
  "raw": {
    "id": "message.plpgsql-trigger-no-return",
    "limits": "The same trigger template appears at more than one fixed control-flow path.",
    "primary_template": "control reached end of trigger procedure without RETURN",
    "severity_source": "ERROR",
    "sources": [
      "src.path.0"
    ],
    "sqlstate": "2F005"
  },
  "severity": "ERROR",
  "sources": [
    "src.path.0"
  ],
  "templates": [
    {
      "kind": "primary",
      "literal": "control reached end of trigger procedure without RETURN",
      "position": 0,
      "role": "",
      "template": "control reached end of trigger procedure without RETURN"
    }
  ]
}
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#L289"
}
sources · src.path.0
{
  "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
  "docs_url": "",
  "kind": "upstream_source",
  "location": "",
  "path": "src/pl/plpgsql/src/pl_exec.c",
  "position": 1,
  "sha256": "0df3c70a6bccf6dddf443fb99e152a16a67009827c44a820597e98e585cb8b20",
  "source_id": "src.path.0",
  "tag": "REL_18_6",
  "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/pl/plpgsql/src/pl_exec.c#L639"
}
sources · src.calls.REL_18_6
{
  "commit": "",
  "docs_url": "",
  "kind": "local_artifact",
  "location": "",
  "path": "raw/calls/REL_18_6.jsonl",
  "position": 2,
  "sha256": "9ee8a0e81d8f0825c5c1ae45583439859a26e602bdd4ce2f2a62aa278867ccbf",
  "source_id": "src.calls.REL_18_6",
  "tag": "",
  "url": ""
}

来源引用

完整定义与证据 JSON

定义来源

center · PostgreSQL 18 · english-manuals:0e435c33180d445d75a9f20aa7effdb7cdf52ea4ef7a069fe269a95a63e7b08f

正文语言: zh-Hans · english-manuals:0e435c33180d445d75a9f20aa7effdb7cdf52ea4ef7a069fe269a95a63e7b08f