{
  "schema": 1,
  "sqlstate": "34000",
  "condition_name": "invalid_cursor_name",
  "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.portalcmds.18.6",
      "kind": "upstream_source",
      "source_role": "source_path",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "src/backend/commands/portalcmds.c",
      "sha256": "e71c5bdb2da67771fb5f42f18b823e8af3ee6c31d5314e97a47ad18f7788bf35",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/commands/portalcmds.c#L197-L199"
    },
    {
      "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",
      "docs_url": "https://www.postgresql.org/docs/18/sql-declare.html"
    }
  ],
  "claims": [
    {
      "id": "identity",
      "statement": "34000 is the invalid_cursor_name condition in Class 34 and shares the undefined-cursor alias.",
      "sources": [
        "src.errcodes.18.6"
      ],
      "method": "Read the fixed errcodes.txt row and macro mapping.",
      "limits": "The same SQLSTATE covers several cursor/portal-facing paths."
    },
    {
      "id": "portal-path",
      "statement": "PerformPortalFetch emits cursor \"%s\" does not exist when the named portal is absent.",
      "sources": [
        "src.portalcmds.18.6",
        "src.calls.REL_18_6"
      ],
      "method": "Trace ERRCODE_UNDEFINED_CURSOR in portalcmds.c.",
      "limits": "Other callers use portal or cursor wording; the name is dynamic."
    },
    {
      "id": "lifecycle",
      "statement": "A named cursor belongs to its backend session and transaction lifecycle; closing it or losing its transaction makes a later FETCH invalid.",
      "sources": [
        "doc.declare.18.6"
      ],
      "method": "Compare DECLARE cursor lifecycle with the explicit same-session registry case.",
      "limits": "Holdable cursors and client-side cursor abstractions have additional rules."
    },
    {
      "id": "runtime",
      "statement": "The selected 34000 case passed on PostgreSQL 18.6 and 10.21 with the structured SQLSTATE, transaction-state, and repair assertions recorded in the runtime entries.",
      "sources": [
        "runtime.34000-batch34-20260909.latest",
        "runtime.34000-batch34-20260909.pg10"
      ],
      "method": "Read the selected runner summaries and raw outputs tied to the shared snippet registry.",
      "limits": "This covers the selected mechanism only, not all source callers or all driver/pool behavior."
    }
  ],
  "messages": [
    {
      "id": "message.cursor-missing",
      "sqlstate": "34000",
      "primary_template": "cursor \"%s\" does not exist",
      "severity_source": "ERROR",
      "sources": [
        "src.portalcmds.18.6"
      ],
      "limits": "The portal protocol path uses portal \"%s\" does not exist."
    }
  ],
  "usage_evidence": [
    {
      "scope": "34000-runtime",
      "status": "observed_runtime",
      "evidence_ids": [
        "runtime",
        "runtime.34000-batch34-20260909.latest",
        "runtime.34000-batch34-20260909.pg10"
      ]
    },
    {
      "scope": "condition-and-source-paths",
      "status": "source_path_confirmed",
      "evidence_ids": [
        "identity",
        "portal-path",
        "lifecycle"
      ]
    }
  ],
  "runtime": [
    {
      "id": "runtime.34000-batch34-20260909.latest",
      "run_id": "34000-batch34-20260909",
      "target": "latest",
      "server_version": "18.6 (Homebrew)",
      "status": "passed",
      "cases": [
        "cursor_lifecycle_recovery"
      ],
      "summary_sha256": "113822682213d49699a80ba97c2d3bad78a795790edfd32e7dbc362d16456e3e",
      "raw_sha256": "91c68dc423bfd301219891f250d584678c5300e1376c9fb6d75731b169d5f560",
      "case_manifest": {
        "sha256": "72347c5c8f1ccfaa18aced582e9ff5bf0f968eff0547c9a8f6521ed7fa3adb47"
      },
      "observed": {
        "sqlstate": "34000",
        "primary": "cursor \"case_cursor_aa951a82\" does not exist",
        "severity": "ERROR",
        "statuses": {
          "after_error": "INERROR",
          "after_repair": "IDLE",
          "after_rollback": "IDLE"
        },
        "repair": {
          "fetched_row": [
            1
          ]
        },
        "connection_autocommit": true
      },
      "snippet_registry": {
        "sha256": "ad5b519e8ca30fd2636b1d0bace32dc18558cccc7b9d360081c27b12a1405f08"
      }
    },
    {
      "id": "runtime.34000-batch34-20260909.pg10",
      "run_id": "34000-batch34-20260909",
      "target": "pg10",
      "server_version": "10.21 (Debian 10.21-1.pgdg90+1)",
      "status": "passed",
      "cases": [
        "cursor_lifecycle_recovery"
      ],
      "summary_sha256": "5c73ff2695864619e3771294e896ec2704bb4fae8e2b16d72aedf220063c2c6a",
      "raw_sha256": "1089cf85363624dcf5430744047b9dfde4760d763ebe10d5ed148047f9bb7c5c",
      "case_manifest": {
        "sha256": "72347c5c8f1ccfaa18aced582e9ff5bf0f968eff0547c9a8f6521ed7fa3adb47"
      },
      "observed": {
        "sqlstate": "34000",
        "primary": "cursor \"case_cursor_d0bb43e5\" does not exist",
        "severity": "ERROR",
        "statuses": {
          "after_error": "INERROR",
          "after_repair": "IDLE",
          "after_rollback": "IDLE"
        },
        "repair": {
          "fetched_row": [
            1
          ]
        },
        "connection_autocommit": true
      },
      "snippet_registry": {
        "sha256": "ad5b519e8ca30fd2636b1d0bace32dc18558cccc7b9d360081c27b12a1405f08"
      }
    }
  ]
}
