# 2F000 — sql_routine_exception

> Source-bounded reference for PostgreSQL SQLSTATE 2F000.
---

# 2F000

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

SQLSTATE 2F000 is the SQL Routine Exception category. The definition is present in the locked catalogue, but the resolved PostgreSQL 18.6 core/contrib call scan did not identify a native 2F000 report group. The class should therefore organize routine-related investigation; it does not identify a particular function declaration, PL/pgSQL statement, or retry rule.

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

| Field | Value |
| --- | --- |
| SQLSTATE | `2F000` |
| Condition | `sql_routine_exception` |
| 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_SQL_ROUTINE_EXCEPTION` |
| Aliases | `—` |

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

## Meaning {#meaning}

2F000 is a category code. Its member 2F002 names one standard routine data-access restriction, but a member path must be confirmed separately. PostgreSQL can report other routine errors with different SQLSTATEs; retain the returned member, message, routine, and server version instead of replacing them with the category.

## Messages {#messages}

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

## Diagnosis {#diagnosis}

Record whether the failure occurred while creating, invoking, or executing a routine, and identify the owner (backend, extension, ECPG, driver, or remote server). Search the fixed implementation for the exact member and message. A category-only observation is insufficient to infer whether a data-access rule, argument error, or routine body caused it.

## Response {#response}

Apply the repair documented by the producing routine implementation and its member SQLSTATE. If a remote or client layer produced the condition, repair that owner’s declaration or call contract. Do not retry a routine category without knowing whether execution began or completed.

## 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}

[`2F002`](../2f002/), [`0Z000`](../0z000/)

## Sources {#sources}

The fixed [errcodes definition](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/errcodes.txt#L288) establishes the category and [the SQLSTATE appendix](https://www.postgresql.org/docs/18/errcodes-appendix.html) lists its members. No resolved native 2F000 report group was found in the locked core/contrib call scan. See the structured [evidence record](../data/evidence/2f000.json) for fixed source paths, scan scope, and unresolved runtime boundaries.
