select open change scope Open full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

SQLSTATE / CLASS 0Z · DIAGNOSTICS EXCEPTION

diagnostics_exception

SQLSTATE
0Z000
Condition name
diagnostics_exception
Class
Diagnostics Exception
Source macro
ERRCODE_DIAGNOSTICS_EXCEPTION
Evidence
Definition only
Analysis & operational context

English SQLSTATE atlas: authored explanations and source/runtime evidence are separate from the manual definitions. View source ↗

<h1>0Z000</h1>

At a glance

SQLSTATE 0Z000 is the Diagnostics Exception category. In PostgreSQL's fixed source, the concrete PL/pgSQL path is the member 0Z002; the category row itself is not a separate report group. Use 0Z000 to classify an observed diagnostics member, then keep the member code and its message for diagnosis.

Meaning

The class covers errors raised while accessing diagnostic state. The resolved member path in pl_exec.c reports 0Z002 when GET STACKED DIAGNOSTICS or parameterless RAISE is used outside an active exception handler. That member evidence explains one PostgreSQL path; it does not make every diagnostics API failure a 0Z000 emission.

Messages

No fixed PostgreSQL message variant was adopted for this condition because the bounded scan did not resolve a native emitting call.

Diagnosis

Read the member code and message first. For 0Z002, inspect whether the statement ran inside the EXCEPTION handler that owns the stacked error; ordinary function control flow and a handler’s scope matter more than the class name. If another member or producer is present, follow that component’s source and preserve its diagnostic fields.

Response

Place GET STACKED DIAGNOSTICS and parameterless RAISE inside the active PL/pgSQL exception handler they depend on. If the intended behavior is to raise a new error outside a handler, supply an explicit condition/message instead of trying to re-use stacked state. Preserve the member error and do not retry a failed routine merely because it belongs to class 0Z.

Versions

The locked catalogue places this condition at least by PostgreSQL 9.2.0. 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.

Sources

The fixed errcodes definition establishes the class. The concrete member paths are GET STACKED DIAGNOSTICS and parameterless RAISE; the PL/pgSQL error-trapping documentation defines the handler boundary. See the structured evidence record for fixed source paths, scan scope, and unresolved runtime boundaries.

Source evidence

Evidence belongs to the frozen source and runtime versions listed here. It is not a runtime verification of the selected manual version.

0Z000 is diagnostics_exception in SQLSTATE Class 0Z.

Method: Read the fixed errcodes definition row, severity, and macro.

src.errcodes.18.6

No resolved 0Z000 report group was found in the locked PostgreSQL 18.6 core/contrib call scan.

Method: Compare resolved report groups with the fixed macro mapping.

Limits: The scan does not cover external wrappers, drivers, extensions, remote systems, or user code; absence from this scan is not an absolute absence claim.

src.calls.REL_18_6 src.errcodes.18.6

The locked release definitions establish catalogue presence from the known 9.2.0 boundary; they do not establish a precise introducing release or runtime use.

Method: Compare canonical release-definition facts with the available history boundary.

Limits: Definition presence is not an emitting-path observation.

src.errcodes.18.6

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.

Version history 1
  1. PG 9.1 → 9.2added

Definition snapshot: english-manuals:f10560533a84e382866cd46e59d… · English manual source