{
  "schema": 1,
  "sqlstate": "22011",
  "condition_name": "substring_error",
  "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#L180",
      "lines": "180"
    },
    {
      "id": "src.text-substring.18.6",
      "kind": "upstream_source",
      "source_role": "resolved_report_context",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "src/backend/utils/adt/varlena.c",
      "sha256": "fd4fa7e214370cabeec0a33792533e4f10037ba763ca1c433ae8795f9f04cd3c",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/adt/varlena.c#L896-1010",
      "lines": "896-1010"
    },
    {
      "id": "src.overlay.18.6",
      "kind": "upstream_source",
      "source_role": "resolved_report_context",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "src/backend/utils/adt/varlena.c",
      "sha256": "fd4fa7e214370cabeec0a33792533e4f10037ba763ca1c433ae8795f9f04cd3c",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/adt/varlena.c#L1166-1186",
      "lines": "1166-1186"
    }
  ],
  "claims": [
    {
      "id": "identity",
      "statement": "22011 is substring_error in SQLSTATE Class 22.",
      "sources": [
        "src.errcodes.18.6"
      ],
      "method": "Read the fixed errcodes row and macro."
    },
    {
      "id": "resolved-text-path",
      "statement": "The fixed text_substring path raises 22011 only for an explicit negative length; the omitted-length sentinel returns the remainder and the start/end calculations cover empty and overflow cases.",
      "sources": [
        "src.text-substring.18.6"
      ],
      "method": "Read the complete text_substring wrapper and guard.",
      "limits": "This is the fixed text path; other substring data types have separate consumers."
    },
    {
      "id": "resolved-overlay-path",
      "statement": "The fixed OVERLAY path reuses the 22011 primary for a non-positive start, while an overflowing start-plus-length uses 22003.",
      "sources": [
        "src.overlay.18.6"
      ],
      "method": "Read the complete OVERLAY guard and overflow branch."
    },
    {
      "id": "history",
      "statement": "The locked catalogue records 22011 from 7.4 without proving an exact implementation introduction date.",
      "sources": [
        "src.errcodes.18.6"
      ],
      "method": "Use catalogue presence and history boundaries."
    }
  ],
  "messages": [
    {
      "id": "message.text-negative-length",
      "sqlstate": "22011",
      "primary_template": "negative substring length not allowed",
      "severity_source": "ERROR",
      "sources": [
        "src.text-substring.18.6"
      ],
      "limits": "Explicit negative text length."
    },
    {
      "id": "message.overlay-nonpositive-start",
      "sqlstate": "22011",
      "primary_template": "negative substring length not allowed",
      "severity_source": "ERROR",
      "sources": [
        "src.overlay.18.6"
      ],
      "limits": "Non-positive OVERLAY start; this is not the OVERLAY overflow branch."
    }
  ],
  "usage_evidence": [
    {
      "scope": "definition",
      "status": "definition_only",
      "evidence_ids": [
        "identity"
      ]
    },
    {
      "scope": "fixed-source-path",
      "status": "source_path_confirmed",
      "evidence_ids": [
        "resolved-text-path",
        "resolved-overlay-path"
      ]
    },
    {
      "scope": "history",
      "status": "unknown",
      "evidence_ids": [
        "history"
      ]
    },
    {
      "scope": "natural-runtime",
      "status": "unknown",
      "evidence_ids": [
        "resolved-text-path"
      ]
    }
  ],
  "runtime": []
}
