09000 — triggered_action_exception
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.
English manual coverage begins with PostgreSQL 8.1. Source history and runtime observations have their own recorded version boundaries.
Reading PG 18·Select a recorded version
- aliases
- Unknown
- class name
- Triggered Action Exception
- condition name
- triggered_action_exception
- lang
- en
- sqlstate
- 09000
Definition PG 18
09000
At a glance {#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.
Meaning {#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 {#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 {#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 {#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 {#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 {#related}
Sources {#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.
Compare versions
SQLSTATE evidence and recorded runtime versions
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": "09000 is triggered_action_exception in SQLSTATE Class 09."
}claims · resolved-path
{
"claim_id": "resolved-path",
"limits": "This is source confirmation, not a runtime observation in this batch.",
"method": "Read the complete source context around the resolved report group.",
"position": 1,
"runtime": [],
"sources": [
"src.spi.autoinc.18.6",
"src.spi.insert_username.18.6",
"src.spi.moddatetime.18.6",
"src.spi.refint.18.6"
],
"statement": "The fixed PostgreSQL 18.6 source contains the report path and message context described on the page."
}claims · history-boundary
{
"claim_id": "history-boundary",
"limits": "Definition presence is not an emitting-path observation.",
"method": "Compare canonical release-definition facts with the available history boundary.",
"position": 2,
"runtime": [],
"sources": [
"src.errcodes.18.6"
],
"statement": "The locked release definitions establish catalogue presence from the known 7.4 boundary; they do not establish a precise introducing release or runtime use."
}messages · message.autoinc-missing-attribute
{
"limits": "Relation and attribute names are dynamic.",
"message_id": "message.autoinc-missing-attribute",
"path": "",
"position": 0,
"raw": {
"id": "message.autoinc-missing-attribute",
"limits": "Relation and attribute names are dynamic.",
"primary_template": "\"%s\" has no attribute \"%s\"",
"severity_source": "ERROR",
"sources": [
"src.spi.autoinc.18.6"
],
"sqlstate": "09000"
},
"severity": "ERROR",
"sources": [
"src.spi.autoinc.18.6"
],
"templates": [
{
"kind": "primary",
"literal": "\" \" has no attribute \" \"",
"position": 0,
"role": "",
"template": "\"%s\" has no attribute \"%s\""
}
]
}messages · message.autoinc-invalid-type
{
"limits": "Attribute and relation names are dynamic.",
"message_id": "message.autoinc-invalid-type",
"path": "",
"position": 1,
"raw": {
"id": "message.autoinc-invalid-type",
"limits": "Attribute and relation names are dynamic.",
"primary_template": "attribute \"%s\" of \"%s\" must be type INT4",
"severity_source": "ERROR",
"sources": [
"src.spi.autoinc.18.6"
],
"sqlstate": "09000"
},
"severity": "ERROR",
"sources": [
"src.spi.autoinc.18.6"
],
"templates": [
{
"kind": "primary",
"literal": "attribute \" \" of \" \" must be type INT4",
"position": 0,
"role": "",
"template": "attribute \"%s\" of \"%s\" must be type INT4"
}
]
}messages · message.insert-username-missing-attribute
{
"limits": "Relation and attribute names are dynamic.",
"message_id": "message.insert-username-missing-attribute",
"path": "",
"position": 2,
"raw": {
"id": "message.insert-username-missing-attribute",
"limits": "Relation and attribute names are dynamic.",
"primary_template": "\"%s\" has no attribute \"%s\"",
"severity_source": "ERROR",
"sources": [
"src.spi.insert_username.18.6"
],
"sqlstate": "09000"
},
"severity": "ERROR",
"sources": [
"src.spi.insert_username.18.6"
],
"templates": [
{
"kind": "primary",
"literal": "\" \" has no attribute \" \"",
"position": 0,
"role": "",
"template": "\"%s\" has no attribute \"%s\""
}
]
}messages · message.insert-username-invalid-type
{
"limits": "Attribute and relation names are dynamic.",
"message_id": "message.insert-username-invalid-type",
"path": "",
"position": 3,
"raw": {
"id": "message.insert-username-invalid-type",
"limits": "Attribute and relation names are dynamic.",
"primary_template": "attribute \"%s\" of \"%s\" must be type TEXT",
"severity_source": "ERROR",
"sources": [
"src.spi.insert_username.18.6"
],
"sqlstate": "09000"
},
"severity": "ERROR",
"sources": [
"src.spi.insert_username.18.6"
],
"templates": [
{
"kind": "primary",
"literal": "attribute \" \" of \" \" must be type TEXT",
"position": 0,
"role": "",
"template": "attribute \"%s\" of \"%s\" must be type TEXT"
}
]
}messages · message.moddatetime-missing-attribute
{
"limits": "Relation and attribute names are dynamic.",
"message_id": "message.moddatetime-missing-attribute",
"path": "",
"position": 4,
"raw": {
"id": "message.moddatetime-missing-attribute",
"limits": "Relation and attribute names are dynamic.",
"primary_template": "\"%s\" has no attribute \"%s\"",
"severity_source": "ERROR",
"sources": [
"src.spi.moddatetime.18.6"
],
"sqlstate": "09000"
},
"severity": "ERROR",
"sources": [
"src.spi.moddatetime.18.6"
],
"templates": [
{
"kind": "primary",
"literal": "\" \" has no attribute \" \"",
"position": 0,
"role": "",
"template": "\"%s\" has no attribute \"%s\""
}
]
}messages · message.moddatetime-invalid-type
{
"limits": "Attribute and relation names are dynamic.",
"message_id": "message.moddatetime-invalid-type",
"path": "",
"position": 5,
"raw": {
"id": "message.moddatetime-invalid-type",
"limits": "Attribute and relation names are dynamic.",
"primary_template": "attribute \"%s\" of \"%s\" must be type TIMESTAMP or TIMESTAMPTZ",
"severity_source": "ERROR",
"sources": [
"src.spi.moddatetime.18.6"
],
"sqlstate": "09000"
},
"severity": "ERROR",
"sources": [
"src.spi.moddatetime.18.6"
],
"templates": [
{
"kind": "primary",
"literal": "attribute \" \" of \" \" must be type TIMESTAMP or TIMESTAMPTZ",
"position": 0,
"role": "",
"template": "attribute \"%s\" of \"%s\" must be type TIMESTAMP or TIMESTAMPTZ"
}
]
}messages · message.refint-missing-key
{
"limits": "Trigger and relation names in DETAIL are dynamic.",
"message_id": "message.refint-missing-key",
"path": "",
"position": 6,
"raw": {
"detail_template": "Trigger \"%s\" found tuple referencing non-existent key in \"%s\".",
"id": "message.refint-missing-key",
"limits": "Trigger and relation names in DETAIL are dynamic.",
"primary_template": "tuple references non-existent key",
"severity_source": "ERROR",
"sources": [
"src.spi.refint.18.6"
],
"sqlstate": "09000"
},
"severity": "ERROR",
"sources": [
"src.spi.refint.18.6"
],
"templates": [
{
"kind": "primary",
"literal": "tuple references non-existent key",
"position": 0,
"role": "",
"template": "tuple references non-existent key"
},
{
"kind": "detail",
"literal": "Trigger \" \" found tuple referencing non-existent key in \" \".",
"position": 1,
"role": "",
"template": "Trigger \"%s\" found tuple referencing non-existent key in \"%s\"."
}
]
}messages · message.refint-spi-status
{
"limits": "The SPI status code is dynamic.",
"message_id": "message.refint-spi-status",
"path": "",
"position": 7,
"raw": {
"id": "message.refint-spi-status",
"limits": "The SPI status code is dynamic.",
"primary_template": "SPI_execp returned %d",
"severity_source": "ERROR",
"sources": [
"src.spi.refint.18.6"
],
"sqlstate": "09000"
},
"severity": "ERROR",
"sources": [
"src.spi.refint.18.6"
],
"templates": [
{
"kind": "primary",
"literal": "SPI_execp returned",
"position": 0,
"role": "",
"template": "SPI_execp returned %d"
}
]
}messages · message.refint-restrictive
{
"limits": "Referencing relation names are dynamic; this is the restrictive action path.",
"message_id": "message.refint-restrictive",
"path": "",
"position": 8,
"raw": {
"id": "message.refint-restrictive",
"limits": "Referencing relation names are dynamic; this is the restrictive action path.",
"primary_template": "\"%s\": tuple is referenced in \"%s\"",
"severity_source": "ERROR",
"sources": [
"src.spi.refint.18.6"
],
"sqlstate": "09000"
},
"severity": "ERROR",
"sources": [
"src.spi.refint.18.6"
],
"templates": [
{
"kind": "primary",
"literal": "\" \": tuple is referenced in \" \"",
"position": 0,
"role": "",
"template": "\"%s\": tuple is referenced in \"%s\""
}
]
}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#L115"
}sources · src.spi.autoinc.18.6
{
"commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
"docs_url": "",
"kind": "upstream_source",
"location": "",
"path": "contrib/spi/autoinc.c",
"position": 1,
"sha256": "154ac91833a2edbfb64f0d9845bff10db45b9bd9ee02e703e52650b2b1fecbf1",
"source_id": "src.spi.autoinc.18.6",
"tag": "REL_18_6",
"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/contrib/spi/autoinc.c"
}sources · src.spi.insert_username.18.6
{
"commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
"docs_url": "",
"kind": "upstream_source",
"location": "",
"path": "contrib/spi/insert_username.c",
"position": 2,
"sha256": "f4102a2487bfcc89d1dd821928bf9a4b9fe31abddd5ff14e8a6e75737c39e9ee",
"source_id": "src.spi.insert_username.18.6",
"tag": "REL_18_6",
"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/contrib/spi/insert_username.c"
}sources · src.spi.moddatetime.18.6
{
"commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
"docs_url": "",
"kind": "upstream_source",
"location": "",
"path": "contrib/spi/moddatetime.c",
"position": 3,
"sha256": "d73f1ba56e2fa74b9cfdf7b1bfa3722d242fdab08988276fc1126936c2cda4e8",
"source_id": "src.spi.moddatetime.18.6",
"tag": "REL_18_6",
"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/contrib/spi/moddatetime.c"
}sources · src.spi.refint.18.6
{
"commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
"docs_url": "",
"kind": "upstream_source",
"location": "",
"path": "contrib/spi/refint.c",
"position": 4,
"sha256": "4197aab0853558bac9db814363b7e294e7e3d079b95f32489fb003a8b5d2d498",
"source_id": "src.spi.refint.18.6",
"tag": "REL_18_6",
"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/contrib/spi/refint.c"
}sources · src.calls.REL_18_6
{
"commit": "",
"docs_url": "",
"kind": "local_artifact",
"location": "",
"path": "raw/calls/REL_18_6.jsonl",
"position": 5,
"sha256": "9ee8a0e81d8f0825c5c1ae45583439859a26e602bdd4ce2f2a62aa278867ccbf",
"source_id": "src.calls.REL_18_6",
"tag": "",
"url": ""
}Source references
Full definition and evidence JSON
Definition sources
center · PostgreSQL 18 · english-manuals:e814051bc33e1114ea774cbdf8c72767fa9e2c9075d6b56bf3b92d8cb0f84b7b
Text language: en · english-manuals:e814051bc33e1114ea774cbdf8c72767fa9e2c9075d6b56bf3b92d8cb0f84b7b