25004
Read PG 18 manual ↗inappropriate_isolation_level_for_branch_transaction
- SQLSTATE
- 25004
- Condition name
- inappropriate_isolation_level_for_branch_transaction
- Class
- Invalid Transaction State
- Source macro
- ERRCODE_INAPPROPRIATE_ISOLATION_LEVEL_FOR_BRANCH_TRANSACTION
- Evidence
- Definition only
English SQLSTATE atlas: authored explanations and source/runtime evidence are separate from the manual definitions. View source ↗
At a glance
25004 names an inappropriate isolation level for a branch transaction. The fixed PostgreSQL 18.6 resolved-call scan has no direct report group for this code, so no ordinary SQL reproduction is claimed.
Meaning
This is a branch-transaction condition, separate from 40001 serialization failure and from the normal SET TRANSACTION ISOLATION LEVEL checks documented for an ordinary transaction.
Diagnosis
Keep the branch API, requested isolation level, and transaction state together when diagnosing it. The source evidence does not justify borrowing a message from another isolation-level error.
Response
Correct the isolation-level negotiation in the branch API, then retry only if that API defines retry semantics. An ordinary SQL session should be diagnosed with the SQLSTATE it actually returned.
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 snapshots. Both runner targets are source-boundary observations with not_applicable case status; no natural trigger is being promoted to runtime coverage.
Sources
src.errcodes.18.6(SHA-2566e8de346643ba84aa3c9c6a73360acfc7b2dfb89162c06c08ce9bf5bcd5bbcba)src.calls.REL_18_6—raw/calls/REL_18_6.jsonl(SHA-2569ee8a0e81d8f0825c5c1ae45583439859a26e602bdd4ce2f2a62aa278867ccbf)
Source evidence
Evidence belongs to the frozen source and runtime versions listed here. It is not a runtime verification of the selected manual version.
25004 is inappropriate_isolation_level_for_branch_transaction in Class 25.
Method: Read the fixed condition row and macro.
Limits: The condition name alone does not identify a supported ordinary-SQL trigger.
The exhaustive resolved PostgreSQL 18.6 call scan contains no direct 25004 report group; no natural SQL reproduction is claimed.
Method: Scan fixed source call records for SQLSTATE 25004.
Limits: Do not substitute a different isolation-level error or a hand-written RAISE example.
- src/backend/utils/errcodes.txt · REL_18_6 ·
724edf9bde9d356724ad384a2e196edc3c9f80f7 raw/calls/REL_18_6.jsonl· ·
Message templates
No extracted message template is attached to this condition.
Reproduction & repair cases
branch_transaction_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: 25004-batch2-latest-20260909
{
"case_status": "not_applicable"
}10.21 (Debian 10.21-1.pgdg90+1) · not_applicable
Run: 25004-batch2-pg10-20260909
{
"case_status": "not_applicable"
}Definition snapshot: english-manuals:f817206f16f39ba9b3a75b86a12… · English manual source