{
  "schema": 1,
  "sqlstate": "25P03",
  "condition_name": "idle_in_transaction_session_timeout",
  "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#L3473-L3501"
    },
    {
      "id": "src.config.18.6",
      "kind": "upstream_source",
      "source_role": "official_documentation",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "doc/src/sgml/config.sgml",
      "sha256": "ffca322c15315ba670733d6b320f23cbba7374db0d18937298ffc07b58799ef6",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/config.sgml#L10252-L10347",
      "docs_url": "https://www.postgresql.org/docs/18/runtime-config-client.html"
    },
    {
      "id": "doc.monitoring.18.6",
      "kind": "upstream_source",
      "source_role": "official_documentation",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "doc/src/sgml/monitoring.sgml",
      "sha256": "06b147f8d966fe46821871703ffcee8a3449cc3f7de5b64b9177f48569fe96f6",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/monitoring.sgml#L706-L875",
      "docs_url": "https://www.postgresql.org/docs/18/monitoring-stats.html"
    },
    {
      "id": "src.system_views.18.6",
      "kind": "upstream_source",
      "source_role": "source_path",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "src/backend/catalog/system_views.sql",
      "sha256": "418f4ae7472fe0742e6fbdc7a055581602c5131e082aa6f17e2c7269bf711972",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/catalog/system_views.sql#L604-L605",
      "docs_url": "https://www.postgresql.org/docs/18/view-pg-settings.html"
    },
    {
      "id": "doc.protocol.18.6",
      "kind": "upstream_source",
      "source_role": "official_documentation",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "doc/src/sgml/protocol.sgml",
      "sha256": "745339e07ebbc2bb67d98b258e25772ada644ef26011e3cd6b3fcbb435235f89",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/protocol.sgml#L61-L65",
      "docs_url": "https://www.postgresql.org/docs/18/protocol.html"
    }
  ],
  "claims": [
    {
      "id": "identity",
      "statement": "25P03 is idle_in_transaction_session_timeout in Class 25.",
      "sources": [
        "src.errcodes.18.6"
      ],
      "method": "Read the fixed condition row and macro.",
      "limits": "The code is emitted at session termination severity FATAL in the selected path."
    },
    {
      "id": "timeout-path",
      "statement": "ProcessInterrupts emits FATAL 25P03 after the session has remained idle inside an open transaction longer than idle_in_transaction_session_timeout.",
      "sources": [
        "src.postgres.18.6",
        "src.config.18.6",
        "src.calls.REL_18_6"
      ],
      "method": "Trace the timeout interrupt and the fixed configuration documentation.",
      "limits": "The server terminates the connection; ROLLBACK cannot be sent through that dead session."
    },
    {
      "id": "runtime",
      "statement": "Both selected targets received FATAL 25P03 for the exact backend PID, and a fresh owner connection successfully ran SELECT 1 after termination.",
      "sources": [
        "runtime",
        "runtime.25P03-batch2c-latest-20260909.latest",
        "runtime.25P03-batch2c-pg10-20260909.pg10"
      ],
      "method": "Match collector records by PID, SQLSTATE, and message, then probe a fresh connection.",
      "limits": "The selected timeout is 300 ms in a runner-owned disposable target; production timeout policy is deployment-specific."
    },
    {
      "id": "diagnosis-observer-boundary",
      "statement": "The fixed monitoring documentation defines pg_stat_activity as one row per server process with current activity, including xact_start and state_change; pg_settings is defined over pg_show_all_settings for the current backend. Capture timeout settings on the timed session itself, because SHOW or pg_settings on an observer connection cannot establish another backend's effective SET value.",
      "sources": [
        "doc.monitoring.18.6",
        "src.system_views.18.6"
      ],
      "method": "Read the fixed monitoring view documentation and system-view definition before writing the observer/session diagnostic split.",
      "limits": "Visibility of pg_stat_activity fields depends on observer privileges; the selected runtime records establish PID/log correlation, not universal monitoring permissions."
    },
    {
      "id": "state-scope",
      "statement": "The fixed monitoring view distinguishes idle in transaction from idle in transaction (aborted); the timeout documentation's open-transaction scope covers idle waiting, while the selected runtime demonstrates only the non-aborted INTRANS path.",
      "sources": [
        "doc.monitoring.18.6",
        "src.config.18.6"
      ],
      "method": "Read the fixed pg_stat_activity state definitions alongside the timeout GUC description and compare them with the selected runtime status.",
      "limits": "No aborted-transaction timeout was run in this batch; preserve any earlier root error and 25P02 separately when diagnosing that state."
    },
    {
      "id": "termination-rollback",
      "statement": "The fixed protocol documentation states that when the backend closes a connection it rolls back any open incomplete transaction before exiting; the driver cannot send a later ROLLBACK on that closed session.",
      "sources": [
        "doc.protocol.18.6"
      ],
      "method": "Read the fixed protocol session-termination rule and align the recovery prose with the FATAL path.",
      "limits": "This establishes server-side rollback on forced connection close; it does not resolve a separate network failure after a client may have sent COMMIT."
    }
  ],
  "messages": [
    {
      "id": "fatal",
      "sqlstate": "25P03",
      "primary_template": "terminating connection due to idle-in-transaction timeout",
      "severity_source": "FATAL",
      "sources": [
        "src.postgres.18.6"
      ],
      "limits": "This is a static FATAL message; the driver may expose or omit SQLSTATE depending on client stack."
    }
  ],
  "usage_evidence": [
    {
      "scope": "runtime",
      "status": "observed_runtime",
      "evidence_ids": [
        "runtime",
        "runtime.25P03-batch2c-latest-20260909.latest",
        "runtime.25P03-batch2c-pg10-20260909.pg10"
      ]
    },
    {
      "scope": "source-paths",
      "status": "source_path_confirmed",
      "evidence_ids": [
        "identity",
        "timeout-path"
      ]
    }
  ],
  "runtime": [
    {
      "id": "runtime.25P03-batch2c-latest-20260909.latest",
      "run_id": "25P03-batch2c-latest-20260909",
      "target": "latest",
      "server_version": "18.6 (Homebrew)",
      "server_version_num": 180006,
      "status": "passed",
      "case_status": "passed",
      "target_status": "passed",
      "cases": [
        "idle_in_transaction_timeout"
      ],
      "summary_sha256": "ec210989486eb92bda87e874942b5987d23f121f914c780e30851f3fe04e9379",
      "raw_sha256": "eeb467a1908730a03d6eb9cf1e1319a5d658dcb4a0bb42d0907f8045682778bf",
      "snippet_registry": {
        "sha256": "95fd079c8bca77c6e3ffc398e404a218e4f810e5fa36e30127cbc6470a6d6eb2"
      },
      "case_manifest": {
        "sha256": "e6c8d08f3b964c308d1a2c87f64919aa7d914db438456658afa230383c7f27eb"
      },
      "observed": {
        "sqlstate": "25P03",
        "severity": "FATAL",
        "primary": "terminating connection due to idle-in-transaction timeout",
        "backend_pid": 26447,
        "status_before_timeout": "INTRANS",
        "original_connection_closed": true,
        "collector_csv_sqlstate": "25P03",
        "collector_csv_error_severity": "FATAL",
        "collector_json_sqlstate": "25P03",
        "collector_json_error_severity": "FATAL",
        "fresh_connection_probe": 1,
        "fresh_connection_status": "IDLE",
        "recovery_requires_new_connection": true
      }
    },
    {
      "id": "runtime.25P03-batch2c-pg10-20260909.pg10",
      "run_id": "25P03-batch2c-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": [
        "idle_in_transaction_timeout"
      ],
      "summary_sha256": "a76cbc2408369f7baca614ed533cba18d8b7f105d7fd3319107be5c01143917d",
      "raw_sha256": "cc716ef184879dac6e0e6885922e940faa0bfed5ef22ef64e479403db499c7e8",
      "snippet_registry": {
        "sha256": "95fd079c8bca77c6e3ffc398e404a218e4f810e5fa36e30127cbc6470a6d6eb2"
      },
      "case_manifest": {
        "sha256": "e6c8d08f3b964c308d1a2c87f64919aa7d914db438456658afa230383c7f27eb"
      },
      "observed": {
        "sqlstate": "25P03",
        "severity": "FATAL",
        "primary": "terminating connection due to idle-in-transaction timeout",
        "backend_pid": 81,
        "status_before_timeout": "INTRANS",
        "original_connection_closed": true,
        "collector_csv_sqlstate": "25P03",
        "collector_csv_error_severity": "FATAL",
        "collector_json_sqlstate": null,
        "collector_json_error_severity": null,
        "fresh_connection_probe": 1,
        "fresh_connection_status": "IDLE",
        "recovery_requires_new_connection": true
      }
    }
  ]
}
