select open change scope Open full search

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

SQLSTATE / CLASS 25 · INVALID TRANSACTION STATE

held_cursor_requires_same_isolation_level

SQLSTATE
25008
Condition name
held_cursor_requires_same_isolation_level
Class
Invalid Transaction State
Source macro
ERRCODE_HELD_CURSOR_REQUIRES_SAME_ISOLATION_LEVEL
Evidence
Definition only
Analysis & operational context

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

<h1>25008 — held_cursor_requires_same_isolation_level</h1>

At a glance

25008 is reserved for a held cursor whose transaction isolation level is not compatible with the required operation. The fixed PostgreSQL 18.6 core scan has no direct report group for it.

Meaning

This is narrower than 24000 invalid cursor state and unrelated to the general 40001 serialization retry path. A cursor being held across transactions does not by itself prove that 25008 was emitted.

Diagnosis

Capture the cursor declaration, holdability, isolation level of both transactions, and exact SQLSTATE from the actual reporting implementation. This fixed evidence provides no message template or copyable SQL trigger.

Response

Keep the cursor and consuming transaction at a compatible isolation level, or close and re-declare it according to the API contract. Do not substitute a 24000 repair or a generic rollback without the actual state.

Source message and runtime boundary

The fixed errcodes.txt row defines the condition and macro; the resolved call scan in raw/calls/REL_18_6.jsonl contains no direct report group, so this batch publishes no message template and constructs no natural SQL trigger.

Applicability boundary and case

The selected runner cases on PostgreSQL 18.6 and 10.21 are not_applicable; they record the source boundary and contain no copyable SQL trigger. Structured evidence · case export

Versions and limits

The generated facts record the locked catalogue membership. The selected latest and PG10 cases intentionally remain source-only and not_applicable.

Sources

  • src.errcodes.18.6 (SHA-256 6e8de346643ba84aa3c9c6a73360acfc7b2dfb89162c06c08ce9bf5bcd5bbcba)
  • src.calls.REL_18_6raw/calls/REL_18_6.jsonl (SHA-256 9ee8a0e81d8f0825c5c1ae45583439859a26e602bdd4ce2f2a62aa278867ccbf)

Source evidence

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

25008 is held_cursor_requires_same_isolation_level in Class 25.

Method: Read the fixed condition row and macro.

Limits: The condition is about a held cursor and transaction isolation, not every cursor-state error.

src.errcodes.18.6

The exhaustive resolved PostgreSQL 18.6 call scan contains no direct 25008 report group; no natural SQL reproduction or message template is claimed.

Method: Scan fixed source call records for SQLSTATE 25008.

Limits: Do not replace this boundary with 24000 or a fabricated cursor error.

src.calls.REL_18_6

Message templates

No extracted message template is attached to this condition.

Reproduction & repair cases

held_cursor_isolation_boundary · PG 10, 18

Preconditions

  • A runner-owned disposable target is provisioned.

Trigger: Source/definition evidence only; no natural SQL trigger is claimed.

Expected assertions

  • No fabricated SQL trigger is included; the selected run records a definition/source boundary.

Repair: Follow the explicit transaction or source boundary described by the case.

Cleanup: Drop the case schema with an owner connection.

Recorded runtime evidence

18.6 (Homebrew) · not_applicable

Run: 25008-batch2-latest-20260909

{
  "case_status": "not_applicable"
}
10.21 (Debian 10.21-1.pgdg90+1) · not_applicable

Run: 25008-batch2-pg10-20260909

{
  "case_status": "not_applicable"
}

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