38000 — external_routine_exception
38000
At a glance
Class 38 is broad. Fixed PostgreSQL 18.6 paths include external command failures in COPY ... PROGRAM and basebackup_to_shell, UUID library failures, and exceptions propagated from PL/Perl, PL/Python, and PL/Tcl. These are separate implementations under one category.
| Field | Value |
|---|---|
| SQLSTATE | 38000 |
| Condition | external_routine_exception |
| Status | active |
| Known present by | 7.4 |
| Locked snapshots | 9.0.23, 9.1.24, 9.2.24, 9.3.25, 9.4.26, 9.5.25, 9.6.24, 10.23, 11.22, 12.22, 13.23, 14.24, 15.19, 16.15, 17.11, 18.6, 19beta3 |
| Macros | ERRCODE_EXTERNAL_ROUTINE_EXCEPTION |
| Aliases | — |
Meaning
Representative messages include program "%s" failed and shell command "%s" failed, each with an internal wait-status detail; OSSP uuid library failure: %s, OSSP uuid library failure: error code %d, uuid library failure: %d, and the UUID version-mismatch message; PL/Perl reports such as didn't get a return item from function, PL/Python forwards %s with optional detail/context/hint, and PL/Tcl reports could not parse function return value: %s or a context-bearing %s. Keep the dynamic fields and the actual producer; this category has no single fixed message.
Messages
Representative messages include program "%s" failed and shell command "%s" failed, each with an internal wait-status detail; OSSP uuid library failure: %s, OSSP uuid library failure: error code %d, uuid library failure: %d, and the UUID version-mismatch message; PL/Perl reports such as didn't get a return item from function, PL/Python forwards %s with optional detail/context/hint, and PL/Tcl reports could not parse function return value: %s or a context-bearing %s. Keep the dynamic fields and the actual producer; this category has no single fixed message.
Diagnosis
Use the message and context to identify the external boundary: program path and wait result, UUID library operation, or PL language and routine. Inspect the relevant server configuration and handler logs, preserving dynamic %s values and any internal detail.
Response
Repair the named external command, library, or language routine and verify that boundary independently. A failed external action may have side effects; do not replay it until completion and idempotency are known.
Versions
The locked catalogue places this condition at least by PostgreSQL 7.4. The facts block lists the published snapshots; source-path status is limited to the fixed PostgreSQL 18.6 evidence below.
Related
Sources
Read the fixed basebackup_to_shell.c, copyto.c, uuid-ossp.c, plperl.c, and pltcl.c paths alongside the structured evidence record.