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

branch_transaction_already_active

SQLSTATE
25002
Condition name
branch_transaction_already_active
Class
Invalid Transaction State
Source macro
ERRCODE_BRANCH_TRANSACTION_ALREADY_ACTIVE
Evidence
Definition only
Analysis & operational context

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

<h1>25002 — branch_transaction_already_active</h1>

At a glance

25002 names a branch transaction that is already active. It is narrower than 25001 and separate from 25P02; this page records the locked condition definition and the absence of a resolved core 18.6 call site.

Meaning

The code belongs to Class 25, but it should not be used as a generic label for nested transactions or savepoints. PostgreSQL’s core errcodes.txt defines the macro, while the exhaustive resolved 18.6 call scan in this project contains no direct 25002 report group.

Diagnosis

Use the exact server SQLSTATE and transaction context. Distinguish a branch/transaction-management API from ordinary savepoints, subtransactions, active transaction-block restrictions, and failed-transaction recovery. A missing core report group is not permission to infer a message or trigger from another code.

Response

Preserve the branch-management operation and its transaction boundary, then consult the API that created the branch. This batch does not provide a natural SQL repair because no safe core path was confirmed; do not replace the missing path with a hand-written RAISE example.

Source message templates

Applicability boundary

This batch does not construct a natural SQL trigger for 25002; treat it as a source/protocol boundary rather than a copyable reproduction. structured evidence · case export.

Authored evidence IDs: identity, source-boundary. Selected runtime records: —.

Versions

The locked catalogue observes the condition by 7.4 and in all listed formal snapshots. The 18.6 call scan has no resolved core path; extensions or future code may add one.

Sources

  • src.errcodes.18.6 (SHA-256 6e8de346643ba84aa3c9c6a73360acfc7b2dfb89162c06c08ce9bf5bcd5bbcba)
  • src.calls.REL_18_6 (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.

25002 is branch_transaction_already_active in Class 25.

Method: Read the fixed errcodes row and macro.

Limits: This is a narrow transaction-branch state, distinct from 25001 active_sql_transaction and 25P02 in_failed_sql_transaction.

src.errcodes.18.6

The exhaustive resolved PostgreSQL 18.6 core call scan has no report group mapped to 25002, so this batch does not claim a safe natural SQL trigger.

Method: Compare the errcodes macro mapping with all resolved report groups.

Limits: A missing core call-site is a bounded source observation; do not manufacture it with RAISE or a guessed replication topology.

src.errcodes.18.6 src.calls.REL_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:43cbb2f81d33cdce4abb3da5826… · English manual source