# 39004 — null_value_not_allowed

> Source-backed reference for PostgreSQL SQLSTATE 39004.
---

# 39004

## At a glance {#at-a-glance}

39004 is `null_value_not_allowed`. The fixed definition is present, but the bounded PostgreSQL 18.6 call archive has no resolved report group for this code; diagnose the actual routine or extension boundary before assigning an operation.

<!-- BEGIN SQLSTATE FACTS: generated by scripts/generate.py; do not edit -->

| Field | Value |
| --- | --- |
| SQLSTATE | `39004` |
| Condition | `null_value_not_allowed` |
| 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_E_R_I_E_NULL_VALUE_NOT_ALLOWED` |
| Aliases | `—` |

<!-- source facts: data/errcodes/39004.json -->
<!-- END SQLSTATE FACTS -->

## Meaning {#meaning}

It identifies a routine-level NULL contract failure, but the fixed source scan does not identify which routine or wrapper emits it. The condition name alone cannot distinguish an argument, return, trigger, or extension boundary.

## Diagnosis {#diagnosis}

Use the full diagnostics to locate the actual routine or extension, then inspect the deployed implementation for this SQLSTATE. The bounded archive is not an absence proof.

## Response {#response}

Fix the NULL contract identified by the actual routine or wrapper, then recheck the operation. Without a confirmed emitting path, avoid code-specific transaction or retry claims.

## Versions {#versions}

The locked catalogue records this condition from 7.4 in the listed formal snapshots and 19beta3; fixed source coverage is PostgreSQL 18.6.

## Related {#related}

[`39000`](../39000/), [`39P01`](../39p01/)

## Sources {#sources}

See the fixed source links, message templates, and scope limits in the structured [evidence record](../data/evidence/39004.json).
