select open change scope Open full search

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

SQLSTATE / CLASS 2F · SQL ROUTINE EXCEPTION

modifying_sql_data_not_permitted

SQLSTATE
2F002
Condition name
modifying_sql_data_not_permitted
Class
SQL Routine Exception
Source macro
ERRCODE_S_R_E_MODIFYING_SQL_DATA_NOT_PERMITTED
Evidence
Definition only
Analysis & operational context

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

<h1>2F002</h1>

At a glance

SQLSTATE 2F002 names the standard SQL Routine Exception member for modifying SQL data when the routine’s declared data-access contract does not permit it. The locked PostgreSQL 18.6 definition contains the member, but its resolved core/contrib call scan has no native report group. Do not infer that PostgreSQL VOLATILE, STABLE, or IMMUTABLE alone maps to this SQLSTATE.

Meaning

The condition is about a routine data-access restriction in an implementation that enforces that contract. The PostgreSQL catalogue row supplies identity and the macro; it does not establish a backend enforcement path or a particular routine language. An extension, embedded-SQL implementation, driver, or remote server may use the standard member independently.

Messages

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

Diagnosis

First preserve the actual SQLSTATE and inspect the routine declaration and the owner that enforced it. Determine whether the attempted statement modified data, whether the routine was declared with a restrictive data-access characteristic, and whether the code came from a remote or client implementation. If the server returned another code, follow that code rather than treating 2F002 as a synonym for a PostgreSQL function volatility error.

Response

Change the routine’s data-access declaration only when the producing implementation documents that as the supported repair, or move the data-modifying work to an allowed routine boundary. Otherwise correct the caller or remote contract. Do not add a generic retry: a rejected data change did not by itself establish whether surrounding work was committed.

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.

Sources

The fixed errcodes definition establishes the member and macro; the SQLSTATE appendix identifies the standard condition. The locked core/contrib scan found no resolved native 2F002 report group. 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.

2F002 is modifying_sql_data_not_permitted in SQLSTATE Class 2F.

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

src.errcodes.18.6

No resolved 2F002 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 7.4 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.

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