{
  "schema": 1,
  "sqlstate": "2201W",
  "condition_name": "invalid_row_count_in_limit_clause",
  "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#L188",
      "lines": "188"
    },
    {
      "id": "src.nodeLimit.limit",
      "kind": "upstream_source",
      "source_role": "resolved_report_context",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "src/backend/executor/nodeLimit.c",
      "sha256": "f4c202d7182d66c6bef222fa50439831691dd99bfa5fd6b4de7f9142635dc305",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/executor/nodeLimit.c#L347",
      "lines": "347-405"
    },
    {
      "id": "src.parse_clause.with_ties",
      "kind": "upstream_source",
      "source_role": "resolved_report_context",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "src/backend/parser/parse_clause.c",
      "sha256": "fd3fb69d6ea2ed0c220eba1d4479c0b79d8713b39a28c62cc4bf1428491e8ebd",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/parser/parse_clause.c#L1890",
      "lines": "1890-1907"
    }
  ],
  "claims": [
    {
      "id": "identity",
      "statement": "2201W is invalid_row_count_in_limit_clause in SQLSTATE Class 22",
      "sources": [
        "src.errcodes.18.6"
      ],
      "method": "Read the fixed errcodes row and macro."
    },
    {
      "id": "resolved-path",
      "statement": "Fixed PostgreSQL 18.6 executor and parser paths distinguish ordinary LIMIT NULL/zero/negative values from the narrow literal NULL WITH TIES guard.",
      "sources": [
        "src.nodeLimit.limit",
        "src.parse_clause.with_ties"
      ],
      "method": "Read complete source contexts for the representative guards.",
      "limits": "Source confirmation is not a natural runtime observation."
    },
    {
      "id": "history",
      "statement": "The locked catalogue records 2201W from 8.4.0 without proving an exact implementation introduction date.",
      "sources": [
        "src.errcodes.18.6"
      ],
      "method": "Use catalogue presence and history boundaries."
    }
  ],
  "messages": [
    {
      "id": "message.limit-negative",
      "primary_template": "LIMIT must not be negative",
      "severity_source": "ERROR",
      "sources": [
        "src.nodeLimit.limit"
      ],
      "sqlstate": "2201W"
    },
    {
      "id": "message.with-ties-null",
      "primary_template": "row count cannot be null in FETCH FIRST ... WITH TIES clause",
      "severity_source": "ERROR",
      "sources": [
        "src.parse_clause.with_ties"
      ],
      "sqlstate": "2201W"
    }
  ],
  "usage_evidence": [
    {
      "scope": "definition",
      "status": "definition_only",
      "evidence_ids": [
        "identity"
      ]
    },
    {
      "scope": "fixed-source-path",
      "status": "source_path_confirmed",
      "evidence_ids": [
        "resolved-path"
      ]
    },
    {
      "scope": "history",
      "status": "unknown",
      "evidence_ids": [
        "history"
      ]
    },
    {
      "scope": "natural-runtime",
      "status": "unknown",
      "evidence_ids": [
        "resolved-path"
      ]
    }
  ],
  "runtime": []
}
