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

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

百科 / 错误代码 / Class 38 外部例程异常

38000 external_routine_exception

ERROR 源码确认 参考 未实测

类别
Class 38 外部例程异常
严重等级
ERROR
条件名
external_routine_exception
宏名称
ERRCODE_EXTERNAL_ROUTINE_EXCEPTION
启用版本
7.4
状态
活跃

版本覆盖

速览

SQLSTATE 38000 是外部例程异常类别。固定的 PostgreSQL 18.6 路径覆盖外部命令、UUID 库和 PL 语言处理器;这些实现必须按各自边界分别诊断。

含义

代表性消息包括 program "%s" failedshell command "%s" failed,二者都带内部 wait-status detail;UUID 路径还会报告 OSSP uuid library failure: %sOSSP uuid library failure: error code %duuid library failure: %d 或 UUID 版本不匹配;PL/Perl 有 didn't get a return item from function 等报文,PL/Python 会转发带可选 detail/context/hint 的 %s,PL/Tcl 则有 could not parse function return value: %s 或带上下文的 %s。应保留动态字段和实际产生者;这个类别没有一条固定消息。

消息

代表性消息包括 program "%s" failedshell command "%s" failed,二者都带内部 wait-status detail;UUID 路径还会报告 OSSP uuid library failure: %sOSSP uuid library failure: error code %duuid library failure: %d 或 UUID 版本不匹配;PL/Perl 有 didn't get a return item from function 等报文,PL/Python 会转发带可选 detail/context/hint 的 %s,PL/Tcl 则有 could not parse function return value: %s 或带上下文的 %s。应保留动态字段和实际产生者;这个类别没有一条固定消息。

报文模板

源码里的格式串,不是某一次运行的输出。%s 之类是占位符,实际报文会填入对象名与取值。适用范围一栏是核验时留下的原始英文记录,未经翻译。

主消息 shell command "%s" failed
DETAIL %s

来源:contrib/basebackup_to_shell/basebackup_to_shell.c @ REL_18_6

适用范围:The command and internal wait-status detail are dynamic.

主消息 program "%s" failed
DETAIL %s

来源:src/backend/commands/copyfrom.c @ REL_18_6 · src/backend/commands/copyto.c @ REL_18_6

适用范围:The program path and internal wait-status detail are dynamic.

主消息 OSSP uuid library failure: %s

来源:contrib/uuid-ossp/uuid-ossp.c @ REL_18_6

适用范围:The external UUID library text is interpolated into the primary message.

主消息 OSSP uuid library failure: error code %d

来源:contrib/uuid-ossp/uuid-ossp.c @ REL_18_6

适用范围:The external UUID status code is dynamic.

主消息 uuid library failure: %d

来源:contrib/uuid-ossp/uuid-ossp.c @ REL_18_6

适用范围:The UUID library status value is dynamic; this branch is used by the uuid-ossp fallback path.

主消息 uuid_create() produced a version %c UUID instead of the expected version 1

来源:contrib/uuid-ossp/uuid-ossp.c @ REL_18_6

适用范围:The UUID version character is dynamic.

主消息 didn't get a return item from function

来源:src/pl/plperl/plperl.c @ REL_18_6

来源:src/pl/plpython/plpy_elog.c @ REL_18_6

适用范围:PL/Python forwards the underlying dynamic message and optional DETAIL, CONTEXT, and HINT; no single static primary template is asserted.

主消息 could not parse function return value: %s

来源:src/pl/tcl/pltcl.c @ REL_18_6

适用范围:The parse error text is dynamic.

主消息 %s
CONTEXT %s in PL/Tcl function %s

来源:src/pl/tcl/pltcl.c @ REL_18_6

适用范围:Both error text and function name are dynamic.

诊断

根据消息和 context 确认外部边界:程序路径及等待结果、UUID 库操作,还是 PL 语言和例程。检查相关服务器配置和处理器日志,保留动态 %s 值及内部 detail。

处理

修复消息点名的外部命令、库或语言例程,并独立验证该边界。外部动作失败时可能已经产生副作用;在确认完成状态和幂等性前不要重放。

版本

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

来源

证据

断言

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

同类错误代码

Class 38 外部例程异常 下的其他成员。