# 22037 — non_unique_keys_in_a_json_object

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

# 22037

## At a glance {#at-a-glance}
The locked condition names a non-unique-key error for a JSON object. No fixed PostgreSQL 18.6 emitting path was resolved in the bounded scan.

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

| Field | Value |
| --- | --- |
| SQLSTATE | `22037` |
| Condition | `non_unique_keys_in_a_json_object` |
| Status | `active` |
| Known present by | `12.0` |
| Locked snapshots | `12.22, 13.23, 14.24, 15.19, 16.15, 17.11, 18.6, 19beta3` |
| Macros | `ERRCODE_NON_UNIQUE_KEYS_IN_A_JSON_OBJECT` |
| Aliases | `—` |

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

## Meaning {#meaning}
The definition identifies `non_unique_keys_in_a_json_object`, but the bounded PostgreSQL 18.6 source review did not resolve a native 22037 emitter. This page therefore records the condition identity and diagnostic boundary without assigning a SQL/JSON constructor, parser, primary text, DETAIL, or HINT.

## Diagnosis {#diagnosis}
If a deployment reports 22037, keep the complete primary, DETAIL, HINT, invoking SQL/JSON operation, and version together. Use that context to determine which object and duplicate-key policy emitted the condition; do not replace it with the related 22030 duplicate-key construction path.

## Response {#response}
Follow the actual emitter's duplicate-key policy: normalize or reject repeated keys according to that operation's documented rule. If an ERROR occurred in an explicit transaction, roll back or roll back to the existing savepoint before retrying; autocommit can retry the corrected action.

## Versions {#versions}
The locked catalogue records this condition from 12.0. Only the PostgreSQL 18.6 definition row is fixed here; no native emitting path or natural runtime observation is claimed.

## Related {#related}
[`22030`](../22030/), [`22032`](../22032/), [`2203A`](../2203a/)

## Sources {#sources}
The fixed definition row is [`errcodes.txt#L222`](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/errcodes.txt#L222). The bounded source review did not resolve a native 22037 emitting path; the structured [evidence record](../data/evidence/22037.json) keeps that unknown scope explicit, and no natural runtime was run.
