09000 — triggered_action_exception
09000
At a glance
SQLSTATE 09000 is an ERROR-level triggered-action condition. In the fixed PostgreSQL 18.6 scan, resolved report paths are in contrib/spi trigger functions: they validate trigger arguments, target-column types, referenced tuples, and SPI return codes. The code is therefore tied to those installed trigger functions and their table/trigger configuration; it is not a label for every trigger failure.
| Field | Value |
|---|---|
| SQLSTATE | 09000 |
| Condition | triggered_action_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_TRIGGERED_ACTION_EXCEPTION |
| Aliases | — |
Meaning
The confirmed paths include autoinc.c, insert_username.c, moddatetime.c, and refint.c. Their message variants include "%s" has no attribute "%s", attribute "%s" of "%s" must be type INT4, ... TEXT, or ... TIMESTAMP or TIMESTAMPTZ. Referential-integrity support also reports tuple references non-existent key with detail Trigger "%s" found tuple referencing non-existent key in "%s"., can report SPI_execp returned %d, and can report "%s": tuple is referenced in "%s" for a restrictive action. These formats contain relation, argument, attribute, trigger, and return-code values supplied by the failing path.
Messages
The confirmed paths include autoinc.c, insert_username.c, moddatetime.c, and refint.c. Their message variants include "%s" has no attribute "%s", attribute "%s" of "%s" must be type INT4, ... TEXT, or ... TIMESTAMP or TIMESTAMPTZ. Referential-integrity support also reports tuple references non-existent key with detail Trigger "%s" found tuple referencing non-existent key in "%s"., can report SPI_execp returned %d, and can report "%s": tuple is referenced in "%s" for a restrictive action. These formats contain relation, argument, attribute, trigger, and return-code values supplied by the failing path.
Diagnosis
First identify the installed trigger function and operation phase, then compare the relation and trigger arguments with the function’s documented contract. For an attribute/type message, inspect the named column and its type; for the refint variants, inspect the trigger name, referenced relation, and the tuple or key relationship. For SPI_execp returned %d, preserve the numeric return code and inspect the SPI call that returned it. The fixed scan does not establish a single message for all 09000 reports.
Response
Correct the trigger definition, argument list, column type, referenced key, or SPI-side failure identified by the message, then rerun the triggering operation after verifying the change. Do not repair this by blindly replaying a write: a trigger may have performed work before the error, and the correct boundary depends on the surrounding transaction. If the function is supplied by an extension or local code, inspect that implementation and its version before changing application retry behavior.
Versions
The locked catalogue places this condition at least by PostgreSQL 7.4. The release definitions cover the published snapshots listed in the facts block; source-path status is limited to the fixed PostgreSQL 18.6 context cited below.
Related
Sources
autoinc.c, insert_username.c, moddatetime.c, and refint.c and its referential-restriction branch show the fixed emitters; the SPI trigger documentation describes the extension interface. See the structured evidence record for fixed source paths, scan scope, and unresolved runtime boundaries.