{
  "schema": 1,
  "sqlstate": "25P02",
  "condition_name": "in_failed_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.postgres.18.6",
      "kind": "upstream_source",
      "source_role": "source_path",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "src/backend/tcop/postgres.c",
      "sha256": "9fb62275b1badf94d01ab351337b60410cd9b3ab1fe63fa9f23d6d2185a21061",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/tcop/postgres.c#L1127-L1140"
    },
    {
      "id": "doc.libpq.18.6",
      "kind": "upstream_source",
      "source_role": "official_documentation",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "doc/src/sgml/libpq.sgml",
      "sha256": "a91ce8f29dde162245d2f35f839e8b7192f62a57e01020b80564af65edd09440",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/libpq.sgml#L2818-L2835",
      "docs_url": "https://www.postgresql.org/docs/18/libpq-status.html"
    }
  ],
  "claims": [
    {
      "id": "identity",
      "statement": "25P02 is in_failed_sql_transaction in Class 25.",
      "sources": [
        "src.errcodes.18.6"
      ],
      "method": "Read the fixed condition row and macro.",
      "limits": "It describes the transaction state after a prior error; it is often a secondary diagnostic."
    },
    {
      "id": "abort-state",
      "statement": "After an error aborts a transaction block, postgres.c rejects subsequent commands with 25P02 until COMMIT/ROLLBACK ends the block.",
      "sources": [
        "src.postgres.18.6",
        "src.calls.REL_18_6",
        "doc.libpq.18.6"
      ],
      "method": "Trace IsAbortedTransactionBlockState and the libpq PQTRANS_INERROR state.",
      "limits": "The first error remains the root cause; 25P02 tells the client to stop issuing ordinary work and end the transaction."
    },
    {
      "id": "runtime",
      "statement": "The selected case first raises 23505, then observes 25P02 while INERROR, rolls back to IDLE, and commits a valid row in a new explicit transaction on both targets.",
      "sources": [
        "runtime",
        "runtime.25P02-batch2-latest-20260909.latest",
        "runtime.25P02-batch2-pg10-20260909.pg10"
      ],
      "method": "Read the selected summaries and structured diagnostics.",
      "limits": "The repair demonstrates transaction-state recovery; it does not make the original duplicate valid."
    }
  ],
  "messages": [
    {
      "id": "aborted",
      "sqlstate": "25P02",
      "primary_template": "current transaction is aborted, commands ignored until end of transaction block",
      "severity_source": "ERROR",
      "sources": [
        "src.postgres.18.6"
      ],
      "limits": "The message is secondary to the earlier statement error; errdetail_abort may add context."
    }
  ],
  "usage_evidence": [
    {
      "scope": "runtime",
      "status": "observed_runtime",
      "evidence_ids": [
        "runtime",
        "runtime.25P02-batch2-latest-20260909.latest",
        "runtime.25P02-batch2-pg10-20260909.pg10"
      ]
    },
    {
      "scope": "source-paths",
      "status": "source_path_confirmed",
      "evidence_ids": [
        "identity",
        "abort-state"
      ]
    }
  ],
  "runtime": [
    {
      "id": "runtime.25P02-batch2-latest-20260909.latest",
      "run_id": "25P02-batch2-latest-20260909",
      "target": "latest",
      "server_version": "18.6 (Homebrew)",
      "server_version_num": 180006,
      "status": "passed",
      "case_status": "passed",
      "target_status": "passed",
      "cases": [
        "failed_transaction_recovery"
      ],
      "summary_sha256": "6c06ba72ebf7ce12c171d8a45ceec233b03eedc0db98796221d00c8b0e34732d",
      "raw_sha256": "f03391117a5430c0611c72a1fa03ee6169f72575e69733a98023b0c9fb255788",
      "case_manifest": {
        "sha256": "dc6dea41ff7dc64f413c290151ee8200b11d66050eb5de499c64ef7aaf87f88c"
      },
      "snippet_registry": {
        "sha256": "04da3240dcf3c03fe60d13715f8187350fadf5b8d1f10e5b837acd45289759cd"
      },
      "observed": {
        "root_sqlstate": "23505",
        "root_primary": "duplicate key value violates unique constraint \"items_note_key\"",
        "sqlstate": "25P02",
        "primary": "current transaction is aborted, commands ignored until end of transaction block",
        "after_root_error": "INERROR",
        "after_25P02": "INERROR",
        "after_rollback": "IDLE",
        "final_status": "IDLE",
        "rows_after_retry": [
          [
            1,
            "seed"
          ],
          [
            2,
            "repaired"
          ]
        ]
      }
    },
    {
      "id": "runtime.25P02-batch2-pg10-20260909.pg10",
      "run_id": "25P02-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": [
        "failed_transaction_recovery"
      ],
      "summary_sha256": "722e8d8c8ddc1301c1c7acb98d9e6442dde6f3a2020246b30775dec8c98a3847",
      "raw_sha256": "97d4ce9f816c98c09408bd00921a97e33708ccf52ca10da0682ab7238ef377a6",
      "case_manifest": {
        "sha256": "dc6dea41ff7dc64f413c290151ee8200b11d66050eb5de499c64ef7aaf87f88c"
      },
      "snippet_registry": {
        "sha256": "04da3240dcf3c03fe60d13715f8187350fadf5b8d1f10e5b837acd45289759cd"
      },
      "observed": {
        "root_sqlstate": "23505",
        "root_primary": "duplicate key value violates unique constraint \"items_note_key\"",
        "sqlstate": "25P02",
        "primary": "current transaction is aborted, commands ignored until end of transaction block",
        "after_root_error": "INERROR",
        "after_25P02": "INERROR",
        "after_rollback": "IDLE",
        "final_status": "IDLE",
        "rows_after_retry": [
          [
            1,
            "seed"
          ],
          [
            2,
            "repaired"
          ]
        ]
      }
    }
  ]
}
