{
  "schema": 1,
  "sqlstate": "22016",
  "condition_name": "invalid_argument_for_nth_value_function",
  "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#L186",
      "lines": "186"
    },
    {
      "id": "src.nth-value.18.6",
      "kind": "upstream_source",
      "source_role": "resolved_report_context",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "src/backend/utils/adt/windowfuncs.c",
      "sha256": "49214f9325dcdd73728d08574b0b6843e90822a18bdaf6b0d49139b1eaae6b63",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/adt/windowfuncs.c#L686-715",
      "lines": "686-715"
    }
  ],
  "claims": [
    {
      "id": "identity",
      "statement": "22016 is invalid_argument_for_nth_value_function in SQLSTATE Class 22.",
      "sources": [
        "src.errcodes.18.6"
      ],
      "method": "Read the fixed errcodes row and macro."
    },
    {
      "id": "resolved-path",
      "statement": "window_nth_value returns NULL for a NULL ordinal, raises 22016 for a non-positive ordinal, and returns NULL when a valid positive ordinal selects no row in the current frame or a NULL value.",
      "sources": [
        "src.nth-value.18.6"
      ],
      "method": "Read the complete ordinal check, frame lookup, and NULL result path."
    },
    {
      "id": "history",
      "statement": "The locked catalogue records 22016 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.nonpositive-ordinal",
      "sqlstate": "22016",
      "primary_template": "argument of nth_value must be greater than zero",
      "severity_source": "ERROR",
      "sources": [
        "src.nth-value.18.6"
      ]
    }
  ],
  "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": []
}
