{
  "schema": 1,
  "sqlstate": "25001",
  "condition_name": "active_sql_transaction",
  "sources": [
    {
      "id": "src.errcodes.18.6",
      "kind": "upstream_source",
      "source_role": "condition_definition",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "src/backend/utils/errcodes.txt",
      "sha256": "6e8de346643ba84aa3c9c6a73360acfc7b2dfb89162c06c08ce9bf5bcd5bbcba",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/errcodes.txt"
    },
    {
      "id": "src.calls.REL_18_6",
      "kind": "local_artifact",
      "source_role": "source_call_scan",
      "sha256": "9ee8a0e81d8f0825c5c1ae45583439859a26e602bdd4ce2f2a62aa278867ccbf"
    },
    {
      "id": "src.xact.18.6",
      "kind": "upstream_source",
      "source_role": "source_path",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "src/backend/access/transam/xact.c",
      "sha256": "75b012c0b047d1dc905a30975c244beec366e45eac0dbf109fd21bcd611a8e39",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/access/transam/xact.c#L3654-L3677"
    },
    {
      "id": "doc.vacuum.18.6",
      "kind": "upstream_source",
      "source_role": "official_documentation",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "doc/src/sgml/ref/vacuum.sgml",
      "sha256": "80ca5592cda7b74938385f84f09faac33574374c1a05d605a2d55982e4cf1bbf",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/ref/vacuum.sgml",
      "docs_url": "https://www.postgresql.org/docs/18/sql-vacuum.html"
    },
    {
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "id": "src.logical.18.6",
      "kind": "upstream_source",
      "path": "src/backend/replication/logical/logical.c",
      "sha256": "3f1bd4c3e627fe78522c4dc9bacf9fa8200e6c82c2d01f7670706eee102b76d1",
      "source_role": "source_path",
      "tag": "REL_18_6",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/replication/logical/logical.c#L444-L446"
    },
    {
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "id": "src.snapmgr-export.18.6",
      "kind": "upstream_source",
      "path": "src/backend/utils/time/snapmgr.c",
      "sha256": "b605b69e77a026c143f4cabca079de364b9a8732bfc40f7595be44fb0971ee8",
      "source_role": "source_path",
      "tag": "REL_18_6",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/time/snapmgr.c#L1152-L1154"
    },
    {
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "id": "src.snapmgr-set-snapshot.18.6",
      "kind": "upstream_source",
      "path": "src/backend/utils/time/snapmgr.c",
      "sha256": "b605b69e77a026c143f4cabca079de364b9a8732bfc40f7595be44fb0971ee8",
      "source_role": "source_path",
      "tag": "REL_18_6",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/time/snapmgr.c#L1409-L1411"
    }
  ],
  "claims": [
    {
      "id": "identity",
      "statement": "25001 is active_sql_transaction in Class 25.",
      "sources": [
        "src.errcodes.18.6"
      ],
      "method": "Read the fixed condition row and macro.",
      "limits": "The code covers several operations that require a transaction boundary, including subtransactions and function execution."
    },
    {
      "id": "utility-path",
      "statement": "A utility such as VACUUM cannot run inside an explicit transaction block; xact.c formats the statement name into the 25001 primary message.",
      "sources": [
        "src.xact.18.6",
        "doc.vacuum.18.6",
        "src.calls.REL_18_6"
      ],
      "method": "Trace PreventInTransactionBlock and the VACUUM transaction restriction.",
      "limits": "Some commands are allowed inside transactions; inspect the command-specific contract rather than retrying blindly."
    },
    {
      "id": "other-paths",
      "statement": "The same SQLSTATE has distinct source templates for subtransactions, function execution, logical replication slots after writes, and snapshot operations; a WARNING “there is already a transaction in progress” is a separate severity path.",
      "sources": [
        "src.xact.18.6",
        "src.calls.REL_18_6",
        "src.logical.18.6",
        "src.snapmgr-export.18.6",
        "src.snapmgr-set-snapshot.18.6"
      ],
      "method": "Read all fixed 25001 report groups selected by the source call scan.",
      "limits": "Severity and recovery depend on the exact path; do not treat every 25001 as an ERROR."
    },
    {
      "id": "runtime",
      "statement": "The selected VACUUM case returned 25001 on PG18.6 and PG10.21, entered INERROR, recovered after ROLLBACK, accepted a follow-up query, and then completed VACUUM outside the transaction block with the connection IDLE.",
      "sources": [
        "runtime.25001-batch1-latest2-20260909.latest",
        "runtime.25001-batch1-pg10b-20260909.pg10"
      ],
      "method": "Read the selected summaries and raw diagnostics.",
      "limits": "The case covers VACUUM in a transaction, not logical replication slots, snapshot export, function calls, or warning handling."
    }
  ],
  "messages": [
    {
      "id": "transaction-block",
      "sqlstate": "25001",
      "primary_template": "%s cannot run inside a transaction block",
      "severity_source": "ERROR",
      "sources": [
        "src.xact.18.6"
      ],
      "limits": "The %s substitution is the command name; this is one ERROR path for 25001."
    },
    {
      "id": "subtransaction",
      "sqlstate": "25001",
      "primary_template": "%s cannot run inside a subtransaction",
      "severity_source": "ERROR",
      "sources": [
        "src.xact.18.6"
      ],
      "limits": "The format string is source-backed; substitutions are supplied by the executing path."
    },
    {
      "id": "already-in-progress",
      "sqlstate": "25001",
      "primary_template": "there is already a transaction in progress",
      "severity_source": "WARNING",
      "sources": [
        "src.xact.18.6"
      ],
      "limits": "This source path is explicitly WARNING and must not be presented as the VACUUM ERROR template."
    },
    {
      "id": "function",
      "limits": "The %s substitution is the command name; this branch is rejected because it is called from a function.",
      "primary_template": "%s cannot be executed from a function",
      "severity_source": "ERROR",
      "sources": [
        "src.xact.18.6"
      ],
      "sqlstate": "25001"
    },
    {
      "id": "logical-slot-after-write",
      "limits": "The source condition is a transaction that already has a top-level transaction ID from writes.",
      "primary_template": "cannot create logical replication slot in transaction that has performed writes",
      "severity_source": "ERROR",
      "sources": [
        "src.logical.18.6"
      ],
      "sqlstate": "25001"
    },
    {
      "id": "snapshot-subtransaction",
      "limits": "The branch rejects export from the current subtransaction; prior committed subtransactions are handled separately by the source.",
      "primary_template": "cannot export a snapshot from a subtransaction",
      "severity_source": "ERROR",
      "sources": [
        "src.snapmgr-export.18.6"
      ],
      "sqlstate": "25001"
    },
    {
      "id": "snapshot-after-query",
      "limits": "The command must be at the top level of a fresh transaction before a query establishes the snapshot.",
      "primary_template": "SET TRANSACTION SNAPSHOT must be called before any query",
      "severity_source": "ERROR",
      "sources": [
        "src.snapmgr-set-snapshot.18.6"
      ],
      "sqlstate": "25001"
    }
  ],
  "usage_evidence": [
    {
      "scope": "vacuum-runtime",
      "status": "observed_runtime",
      "evidence_ids": [
        "runtime",
        "runtime.25001-batch1-latest2-20260909.latest",
        "runtime.25001-batch1-pg10b-20260909.pg10"
      ]
    },
    {
      "scope": "source-paths",
      "status": "source_path_confirmed",
      "evidence_ids": [
        "identity",
        "utility-path",
        "other-paths"
      ]
    }
  ],
  "runtime": [
    {
      "id": "runtime.25001-batch1-latest2-20260909.latest",
      "run_id": "25001-batch1-latest2-20260909",
      "target": "latest",
      "server_version": "18.6 (Homebrew)",
      "server_version_num": 180006,
      "status": "passed",
      "cases": [
        "vacuum_inside_transaction"
      ],
      "summary_sha256": "544bd0ec303a15036fe848468ed90f2674d5c2212e520bf6be2413bfdc91f200",
      "raw_sha256": "0b164ca0eab22ccc7ad5d18ed6201072049d2b7ba49e8cc99ba65aae172e1ec0",
      "snippet_registry": {
        "sha256": "0fc4277a4e2f59e78e54a1fed1ec0efef6bd0d3bd97180e03df596677e847f03"
      },
      "case_manifest": {
        "sha256": "2a5fad757733e23fd68df23270c4b0dfe108ff9ba0e1ab33c4a69e85c46c7ce1"
      },
      "observed": {
        "sqlstate": "25001",
        "primary": "VACUUM cannot run inside a transaction block",
        "after_error": "INERROR",
        "after_rollback": "IDLE",
        "usable": 1,
        "vacuum_outside_transaction": true,
        "status_after_vacuum": "IDLE"
      }
    },
    {
      "id": "runtime.25001-batch1-pg10b-20260909.pg10",
      "run_id": "25001-batch1-pg10b-20260909",
      "target": "pg10",
      "server_version": "10.21 (Debian 10.21-1.pgdg90+1)",
      "server_version_num": 100021,
      "status": "passed",
      "cases": [
        "vacuum_inside_transaction"
      ],
      "summary_sha256": "498a7229697ff6f46b6bbb135c3f79215cbb5442e9ce2400f651bb5efb91b151",
      "raw_sha256": "1efa43a93beca206fe048de038e4538694746fece446eb129a81fb8e36aa2740",
      "snippet_registry": {
        "sha256": "0fc4277a4e2f59e78e54a1fed1ec0efef6bd0d3bd97180e03df596677e847f03"
      },
      "case_manifest": {
        "sha256": "2a5fad757733e23fd68df23270c4b0dfe108ff9ba0e1ab33c4a69e85c46c7ce1"
      },
      "observed": {
        "sqlstate": "25001",
        "primary": "VACUUM cannot run inside a transaction block",
        "after_error": "INERROR",
        "after_rollback": "IDLE",
        "usable": 1,
        "vacuum_outside_transaction": true,
        "status_after_vacuum": "IDLE"
      }
    }
  ]
}
