{
  "schema": 1,
  "sqlstate": "25006",
  "condition_name": "read_only_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.utility.18.6",
      "kind": "upstream_source",
      "source_role": "source_path",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "src/backend/tcop/utility.c",
      "sha256": "7aae5d07628b6debf8456d1d4ea96f28912232192e56ea25773b4c4b61235a00",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/tcop/utility.c#L397-L448"
    },
    {
      "id": "src.namespace.18.6",
      "kind": "upstream_source",
      "source_role": "source_path",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "src/backend/catalog/namespace.c",
      "sha256": "8c9e6a99e84fa2cec8a9b1de2ecbe3966a13f4ad68c6ccfbfb8134a754d73e56",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/catalog/namespace.c#L4418-L4437"
    },
    {
      "id": "src.origin.18.6",
      "kind": "upstream_source",
      "source_role": "source_path",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "src/backend/replication/logical/origin.c",
      "sha256": "81e5d5b4539b67bb372f0f0a05395af900c322cdbcec8a4b1f358333a16e6518",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/replication/logical/origin.c#L189-L200"
    },
    {
      "id": "doc.set-transaction.18.6",
      "kind": "upstream_source",
      "source_role": "official_documentation",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "doc/src/sgml/ref/set_transaction.sgml",
      "sha256": "33554463a2c9da1cf2c72cc27d4647d557204bb13a03cfeccb1b83f237a46589",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/ref/set_transaction.sgml#L131-L145",
      "docs_url": "https://www.postgresql.org/docs/18/sql-set-transaction.html"
    }
  ],
  "claims": [
    {
      "id": "identity",
      "statement": "25006 is read_only_sql_transaction in Class 25.",
      "sources": [
        "src.errcodes.18.6"
      ],
      "method": "Read the fixed condition row and macro.",
      "limits": "The same code covers more than one read-only/recovery guard."
    },
    {
      "id": "utility-path",
      "statement": "PreventCommandIfReadOnly formats the SQL command name into “cannot execute %s in a read-only transaction”; CREATE TABLE is one ordinary utility path.",
      "sources": [
        "src.utility.18.6",
        "src.calls.REL_18_6",
        "doc.set-transaction.18.6"
      ],
      "method": "Trace PreventCommandIfReadOnly and the documented read-only command restrictions.",
      "limits": "The %s substitution is command-specific; recovery and parallel-operation paths have their own conditions/messages."
    },
    {
      "id": "other-paths",
      "statement": "The fixed source also uses 25006 for temporary-table creation during recovery and replication-origin manipulation during recovery.",
      "sources": [
        "src.namespace.18.6",
        "src.origin.18.6"
      ],
      "method": "Read the additional fixed source report groups.",
      "limits": "Those recovery paths were not constructed by the selected ordinary read-only transaction case."
    },
    {
      "id": "runtime",
      "statement": "The selected read-only CREATE TABLE case returned 25006 on PostgreSQL 18.6 and 10.21, entered INERROR, recovered after ROLLBACK, and created the relation outside the read-only transaction.",
      "sources": [
        "runtime",
        "runtime.25006-batch2-latest-20260909.latest",
        "runtime.25006-batch2-pg10-20260909.pg10"
      ],
      "method": "Read the selected summaries and structured diagnostics.",
      "limits": "The case covers the ordinary explicit read-only utility path, not recovery-only temporary-table or replication-origin paths."
    },
    {
      "id": "recovery-utility",
      "statement": "The same fixed utility source uses 25006 during recovery with the command-specific message \"cannot execute %s during recovery\"; this is separate from the selected ordinary read-only transaction path.",
      "sources": [
        "src.utility.18.6",
        "src.calls.REL_18_6"
      ],
      "method": "Read the recovery guard and resolved report group in utility.c.",
      "limits": "The %s substitution is command-specific; the selected runtime did not run on a standby or recovery target."
    }
  ],
  "messages": [
    {
      "id": "utility",
      "sqlstate": "25006",
      "primary_template": "cannot execute %s in a read-only transaction",
      "severity_source": "ERROR",
      "sources": [
        "src.utility.18.6"
      ],
      "limits": "The %s substitution is the command name."
    },
    {
      "id": "utility-recovery",
      "sqlstate": "25006",
      "primary_template": "cannot execute %s during recovery",
      "severity_source": "ERROR",
      "sources": [
        "src.utility.18.6"
      ],
      "limits": "Recovery-only utility path; %s is the command name and this was not the selected ordinary read-only case."
    },
    {
      "id": "recovery-temp",
      "sqlstate": "25006",
      "primary_template": "cannot create temporary tables during recovery",
      "severity_source": "ERROR",
      "sources": [
        "src.namespace.18.6"
      ],
      "limits": "A recovery-only path; not the selected case."
    },
    {
      "id": "recovery-origin",
      "sqlstate": "25006",
      "primary_template": "cannot manipulate replication origins during recovery",
      "severity_source": "ERROR",
      "sources": [
        "src.origin.18.6"
      ],
      "limits": "A recovery-only path; not the selected case."
    }
  ],
  "usage_evidence": [
    {
      "scope": "runtime",
      "status": "observed_runtime",
      "evidence_ids": [
        "runtime",
        "runtime.25006-batch2-latest-20260909.latest",
        "runtime.25006-batch2-pg10-20260909.pg10"
      ]
    },
    {
      "scope": "source-paths",
      "status": "source_path_confirmed",
      "evidence_ids": [
        "identity",
        "utility-path",
        "other-paths"
      ]
    }
  ],
  "runtime": [
    {
      "id": "runtime.25006-batch2-latest-20260909.latest",
      "run_id": "25006-batch2-latest-20260909",
      "target": "latest",
      "server_version": "18.6 (Homebrew)",
      "server_version_num": 180006,
      "status": "passed",
      "case_status": "passed",
      "target_status": "passed",
      "cases": [
        "read_only_transaction"
      ],
      "summary_sha256": "24fcf5d910c49c64eb3277bc4642190fe182f1ae2b731b2dffb0a5474c0189fe",
      "raw_sha256": "b506359510adfe87c3fb8dbf50ed863b7fcdaad5b6bbb7ebf910ecec38c80780",
      "case_manifest": {
        "sha256": "2009137faa2d1ebbbfa4dedfc1be073f9ea41b4bedd6c0acb34f3215ae37e25f"
      },
      "snippet_registry": {
        "sha256": "62db30e401b1f72fa50958d0ac612b2b1eb636299532dd1ad246c167e4f9fadf"
      },
      "observed": {
        "sqlstate": "25006",
        "primary": "cannot execute CREATE TABLE in a read-only transaction",
        "after_error": "INERROR",
        "after_rollback": "IDLE",
        "repair_relation": "\"c25006_read_only_transaction\".\"blocked\"",
        "final_status": "IDLE",
        "rows_after_repair": 0
      }
    },
    {
      "id": "runtime.25006-batch2-pg10-20260909.pg10",
      "run_id": "25006-batch2-pg10-20260909",
      "target": "pg10",
      "server_version": "10.21 (Debian 10.21-1.pgdg90+1)",
      "server_version_num": 100021,
      "status": "passed",
      "case_status": "passed",
      "target_status": "passed",
      "cases": [
        "read_only_transaction"
      ],
      "summary_sha256": "9de68a1e3ec84530fad088519fe71f009fde4dfefd02bd27e15096fb6c5b498a",
      "raw_sha256": "8aa0068ea4575ffc24bc86d329a039a63c80f5e218cad36e9e6bfa3075c8c731",
      "case_manifest": {
        "sha256": "2009137faa2d1ebbbfa4dedfc1be073f9ea41b4bedd6c0acb34f3215ae37e25f"
      },
      "snippet_registry": {
        "sha256": "62db30e401b1f72fa50958d0ac612b2b1eb636299532dd1ad246c167e4f9fadf"
      },
      "observed": {
        "sqlstate": "25006",
        "primary": "cannot execute CREATE TABLE in a read-only transaction",
        "after_error": "INERROR",
        "after_rollback": "IDLE",
        "repair_relation": "\"c25006_read_only_transaction\".\"blocked\"",
        "final_status": "IDLE",
        "rows_after_repair": 0
      }
    }
  ]
}
