{
  "schema": 1,
  "sqlstate": "39P02",
  "condition_name": "srf_protocol_violated",
  "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#L312",
      "lines": "312"
    },
    {
      "id": "src.calls.REL_18_6",
      "kind": "local_artifact",
      "source_role": "source_call_scan",
      "sha256": "9ee8a0e81d8f0825c5c1ae45583439859a26e602bdd4ce2f2a62aa278867ccbf"
    },
    {
      "id": "src.path.srf",
      "kind": "upstream_source",
      "source_role": "resolved_report_context",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "src/backend/executor/execSRF.c",
      "sha256": "5c6038cbcc254113a39119af636331063b11d75ad7757b027620d78ed1ecdf2a",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/executor/execSRF.c#L363-L365",
      "lines": "363-365,371-381,665-686"
    }
  ],
  "claims": [
    {
      "id": "identity",
      "statement": "39P02 is srf_protocol_violated in Class 39.",
      "sources": [
        "src.errcodes.18.6"
      ],
      "method": "Read the fixed definition row."
    },
    {
      "id": "return-modes",
      "statement": "The executor reports this code when a set-returning function violates value-per-call or materialize mode, or supplies an unrecognized returnMode.",
      "sources": [
        "src.path.srf"
      ],
      "method": "Read the rsinfo.returnMode, isDone, and returnsSet checks."
    },
    {
      "id": "boundary",
      "statement": "The fixed path is an executor-to-set-returning-function contract, not an ordinary query row-count condition.",
      "sources": [
        "src.path.srf"
      ],
      "method": "Interpret the source checks in their executor context."
    }
  ],
  "messages": [
    {
      "id": "message.srf-value-per-call",
      "sqlstate": "39P02",
      "primary_template": "table-function protocol for value-per-call mode was not followed",
      "severity_source": "ERROR",
      "sources": [
        "src.path.srf"
      ]
    },
    {
      "id": "message.srf-materialize",
      "sqlstate": "39P02",
      "primary_template": "table-function protocol for materialize mode was not followed",
      "severity_source": "ERROR",
      "sources": [
        "src.path.srf"
      ]
    },
    {
      "id": "message.srf-returnmode",
      "sqlstate": "39P02",
      "primary_template": "unrecognized table-function returnMode: %d",
      "severity_source": "ERROR",
      "sources": [
        "src.path.srf"
      ]
    }
  ],
  "usage_evidence": [
    {
      "scope": "definition",
      "status": "definition_only",
      "evidence_ids": [
        "identity"
      ]
    },
    {
      "scope": "executor-path",
      "status": "source_path_confirmed",
      "evidence_ids": [
        "return-modes"
      ]
    },
    {
      "scope": "natural-runtime",
      "status": "unknown",
      "evidence_ids": [
        "return-modes"
      ]
    }
  ],
  "runtime": []
}
