23000
Read PG 18 manual ↗integrity_constraint_violation
- SQLSTATE
- 23000
- Condition name
- integrity_constraint_violation
- Class
- Integrity Constraint Violation
- Source macro
- ERRCODE_INTEGRITY_CONSTRAINT_VIOLATION
- Evidence
- Definition only
English SQLSTATE atlas: authored explanations and source/runtime evidence are separate from the manual definitions. View source ↗
At a glance
23000 names the Class 23 integrity-constraint umbrella. It is a protocol category, not a reliable substitute for a concrete PostgreSQL constraint error. Use the exact five-character code returned by the server.
Meaning
The class covers row and schema operations that violate declared integrity rules. PostgreSQL’s locked errcodes.txt maps concrete mechanisms to descendants such as 23001, 23502, 23503, 23505, 23514, and 23P01. The core PostgreSQL 18.6 call scan contains no resolved 23000 report group, so this page records a definition and dispatch boundary rather than inventing a natural SQL reproduction.
Diagnosis
Read the server SQLSTATE first, then use constraint_name, table_name, column_name, schema_name, and the primary/detail fields when present. A client that collapses every Class 23 value to 23000 loses the distinction needed to repair a NOT NULL, foreign-key, unique, CHECK, exclusion, or RESTRICT failure.
Response
Keep the original statement and transaction boundary. Handle the concrete descendant if one is returned; repair the data or schema rule that it identifies, roll back a failed explicit transaction, and retry only after the intended invariant is satisfied. Do not emit RAISE EXCEPTION ... ERRCODE 23000 as if it demonstrated a natural server path.
Source message templates
Applicability boundary
This batch does not construct a natural SQL trigger for 23000; treat it as a source/protocol boundary rather than a copyable reproduction. structured evidence · case export.
Authored evidence IDs: identity, specific-codes, handling. Selected runtime records: —.
Versions
The locked catalogue observes the umbrella by 7.4 and in every listed 9.0–18.6 formal snapshot. The absence of a resolved 18.6 core call site is a bounded source observation, not a claim about extensions or future releases.
Sources
src.errcodes.18.6(SHA-2566e8de346643ba84aa3c9c6a73360acfc7b2dfb89162c06c08ce9bf5bcd5bbcba)src.calls.REL_18_6(SHA-2569ee8a0e81d8f0825c5c1ae45583439859a26e602bdd4ce2f2a62aa278867ccbf)
Source evidence
Evidence belongs to the frozen source and runtime versions listed here. It is not a runtime verification of the selected manual version.
23000 is the Class 23 integrity_constraint_violation umbrella condition.
Method: Read the fixed class and condition row.
Limits: The umbrella code is a protocol definition; concrete PostgreSQL constraint paths normally use a more specific Class 23 code.
PostgreSQL source uses specific descendants such as 23001, 23502, 23503, 23505, 23514, and 23P01 for distinct mechanisms; the exhaustive 18.6 call scan has no resolved 23000 report group.
Method: Compare the errcodes mapping with all resolved report groups whose code_candidates contain 23000.
Limits: Absence from this scan is not proof that every extension or future source path can never emit 23000; it bounds this locked core scan.
A client should branch on the exact five-character SQLSTATE and use constraint/object fields rather than collapsing every Class 23 error to 23000.
Method: Read the protocol identity and the specific descendant mappings.
Limits: Do not fabricate a natural 23000 reproduction with RAISE; this batch has no safe core SQL path for it.
- src/backend/utils/errcodes.txt · REL_18_6 ·
724edf9bde9d356724ad384a2e196edc3c9f80f7 raw/calls/REL_18_6.jsonl· ·
Message templates
No extracted message template is attached to this condition.
Reproduction & repair cases
No reproduction case is attached to this condition.
Recorded runtime evidence
No runtime observation is attached to this entry.
Definition snapshot: english-manuals:0e6d5a94db68f07db4ed44aa829… · English manual source