{
  "schema": 1,
  "sqlstate": "24000",
  "condition_name": "invalid_cursor_state",
  "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.execCurrent.18.6",
      "kind": "upstream_source",
      "source_role": "source_path",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "src/backend/executor/execCurrent.c",
      "sha256": "45c8e48b3a5dc46f1014482dc88e0a26c25c3a4c403372112474d9171253d8a9",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/executor/execCurrent.c#L135-L138"
    },
    {
      "id": "doc.declare.18.6",
      "kind": "upstream_source",
      "source_role": "official_documentation",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "doc/src/sgml/ref/declare.sgml",
      "sha256": "f1d72befb9a989aa32123560aea784a8bccfcb3d3930804a101d8245e5a3cc95",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/ref/declare.sgml#L275-L285",
      "docs_url": "https://www.postgresql.org/docs/18/sql-declare.html"
    },
    {
      "id": "doc.update.18.6",
      "kind": "upstream_source",
      "source_role": "official_documentation",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "doc/src/sgml/ref/update.sgml",
      "sha256": "47dd724cd724bd77478215a4853aa1f985996a0e5bba9b2451a1ad1ebb6e51fc",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/ref/update.sgml#L203-L211",
      "docs_url": "https://www.postgresql.org/docs/18/sql-update.html"
    }
  ],
  "claims": [
    {
      "id": "identity",
      "statement": "24000 is invalid_cursor_state in Class 24.",
      "sources": [
        "src.errcodes.18.6"
      ],
      "method": "Read the fixed condition row.",
      "limits": "The class has several cursor/portal states; the observed message is one path."
    },
    {
      "id": "current-of",
      "statement": "UPDATE or DELETE ... WHERE CURRENT OF requires a positioned, updatable cursor row; before FETCH the executor reports 24000.",
      "sources": [
        "src.execCurrent.18.6",
        "doc.declare.18.6",
        "doc.update.18.6",
        "src.calls.REL_18_6"
      ],
      "method": "Trace execCurrent and the documented DECLARE/CURRENT OF rules.",
      "limits": "A cursor can be validly declared yet still be unpositioned; declaration alone does not make CURRENT OF usable."
    },
    {
      "id": "runtime",
      "statement": "The selected explicit transaction case returned 24000 before FETCH, entered INERROR, recovered after ROLLBACK, and then directly repaired the row on PG18.6 and PG10.21.",
      "sources": [
        "runtime.24000-batch1-latest2-20260909.latest",
        "runtime.24000-batch1-pg10-20260909.pg10"
      ],
      "method": "Read the selected summaries and raw diagnostics.",
      "limits": "Only the before-FETCH CURRENT OF path was run; other cursor states use other source templates."
    }
  ],
  "messages": [
    {
      "id": "unpositioned",
      "sqlstate": "24000",
      "primary_template": "cursor \"%s\" is not positioned on a row",
      "severity_source": "ERROR",
      "sources": [
        "src.execCurrent.18.6"
      ],
      "limits": "The same template is also used by another CURRENT OF path; the cursor name is substituted at runtime."
    }
  ],
  "usage_evidence": [
    {
      "scope": "current-of-runtime",
      "status": "observed_runtime",
      "evidence_ids": [
        "runtime",
        "runtime.24000-batch1-latest2-20260909.latest",
        "runtime.24000-batch1-pg10-20260909.pg10"
      ]
    },
    {
      "scope": "cursor-source-path",
      "status": "source_path_confirmed",
      "evidence_ids": [
        "identity",
        "current-of"
      ]
    }
  ],
  "runtime": [
    {
      "id": "runtime.24000-batch1-latest2-20260909.latest",
      "run_id": "24000-batch1-latest2-20260909",
      "target": "latest",
      "server_version": "18.6 (Homebrew)",
      "server_version_num": 180006,
      "status": "passed",
      "cases": [
        "current_of_before_fetch"
      ],
      "summary_sha256": "d14d912dad21157c8911b7ec6f16eb5b995b4efd387cca830b826a4ff17039d6",
      "raw_sha256": "567d6fb5a4c4f6e881050992aa833c79999d5018cba753b41021483f59e7069c",
      "snippet_registry": {
        "sha256": "cafca57825378362df0527384614bf658bf86cd3101e1eb520ea0641819f2789"
      },
      "case_manifest": {
        "sha256": "5a52a1c37d8702961515d9d32e7c5285ca3a9cebe0a16492858864ce933a1b1c"
      },
      "observed": {
        "sqlstate": "24000",
        "primary": "cursor \"item_cursor\" is not positioned on a row",
        "after_error": "INERROR",
        "after_rollback": "IDLE",
        "repaired_row": [
          1,
          "repaired"
        ]
      }
    },
    {
      "id": "runtime.24000-batch1-pg10-20260909.pg10",
      "run_id": "24000-batch1-pg10-20260909",
      "target": "pg10",
      "server_version": "10.21 (Debian 10.21-1.pgdg90+1)",
      "server_version_num": 100021,
      "status": "passed",
      "cases": [
        "current_of_before_fetch"
      ],
      "summary_sha256": "9a38d0b3ee7ffa8f3018ceb09045cc78ae4c2bccd004a6c369cf9cbc76089851",
      "raw_sha256": "cf77c7f96913d2a33315afa186be2fd51eb100f69da7d5540ed708f41b5bde3f",
      "snippet_registry": {
        "sha256": "cafca57825378362df0527384614bf658bf86cd3101e1eb520ea0641819f2789"
      },
      "case_manifest": {
        "sha256": "5a52a1c37d8702961515d9d32e7c5285ca3a9cebe0a16492858864ce933a1b1c"
      },
      "observed": {
        "sqlstate": "24000",
        "primary": "cursor \"item_cursor\" is not positioned on a row",
        "after_error": "INERROR",
        "after_rollback": "IDLE",
        "repaired_row": [
          1,
          "repaired"
        ]
      }
    }
  ]
}
