{
  "schema": 1,
  "sqlstate": "42P20",
  "condition_name": "windowing_error",
  "sources": [
    {
      "id": "src.errcodes.42P20.18.6",
      "kind": "upstream_source",
      "source_role": "condition_definition",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "src/backend/utils/errcodes.txt",
      "location": "line 344",
      "sha256": "6e8de346643ba84aa3c9c6a73360acfc7b2dfb89162c06c08ce9bf5bcd5bbcba",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/errcodes.txt#L344"
    },
    {
      "id": "src.call.42P20.17809e6b7f525d4ed41961ed",
      "kind": "upstream_source",
      "source_role": "source_call",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "src/backend/executor/execExpr.c",
      "location": "lines 1155-1157",
      "sha256": "9bc3aa2562686b1860005137de9611e56ff6b41eaf9b3eefd9c3f058dc057431",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/executor/execExpr.c#L1155-L1157"
    },
    {
      "id": "src.call.42P20.5670c88a2f3e05b693257e49",
      "kind": "upstream_source",
      "source_role": "source_call",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "src/backend/parser/gram.y",
      "location": "lines 16499-16502",
      "sha256": "7e548b673a1e03eb3a56c5eb9ad92d8e11095fac76e14cb258ca851f58274724",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/parser/gram.y#L16499-L16502"
    },
    {
      "id": "src.call.42P20.ed2f8bce483ee7cc9c9ff7e0",
      "kind": "upstream_source",
      "source_role": "source_call",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "src/backend/parser/gram.y",
      "location": "lines 16504-16507",
      "sha256": "7e548b673a1e03eb3a56c5eb9ad92d8e11095fac76e14cb258ca851f58274724",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/parser/gram.y#L16504-L16507"
    },
    {
      "id": "src.call.42P20.af44057d6b02e78ceb659ea3",
      "kind": "upstream_source",
      "source_role": "source_call",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "src/backend/parser/gram.y",
      "location": "lines 16528-16531",
      "sha256": "7e548b673a1e03eb3a56c5eb9ad92d8e11095fac76e14cb258ca851f58274724",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/parser/gram.y#L16528-L16531"
    },
    {
      "id": "src.call.42P20.05acd1c626dd243023930f4b",
      "kind": "upstream_source",
      "source_role": "source_call",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "src/backend/parser/gram.y",
      "location": "lines 16534-16537",
      "sha256": "7e548b673a1e03eb3a56c5eb9ad92d8e11095fac76e14cb258ca851f58274724",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/parser/gram.y#L16534-L16537"
    },
    {
      "id": "src.call.42P20.2b557a2b5c702ff1eeb57eaa",
      "kind": "upstream_source",
      "source_role": "source_call",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "src/backend/parser/gram.y",
      "location": "lines 16541-16544",
      "sha256": "7e548b673a1e03eb3a56c5eb9ad92d8e11095fac76e14cb258ca851f58274724",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/parser/gram.y#L16541-L16544"
    },
    {
      "id": "src.call.42P20.fde5045d9190c4d041b74444",
      "kind": "upstream_source",
      "source_role": "source_call",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "src/backend/parser/parse_agg.c",
      "location": "lines 1041-1046",
      "sha256": "6e80a805fddbfc9c7e0f3047b348bf992a20c99f16ce7fee89c7067753027f72",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/parser/parse_agg.c#L1041-L1046"
    },
    {
      "id": "src.call.42P20.4d72e034c551705933ff1342",
      "kind": "upstream_source",
      "source_role": "source_call",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "src/backend/parser/parse_clause.c",
      "location": "lines 2790-2793",
      "sha256": "fd3fb69d6ea2ed0c220eba1d4479c0b79d8713b39a28c62cc4bf1428491e8ebd",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/parser/parse_clause.c#L2790-L2793"
    },
    {
      "id": "src.call.42P20.0221c1569253594c6c3f8117",
      "kind": "upstream_source",
      "source_role": "source_call",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "src/backend/parser/parse_clause.c",
      "location": "lines 2851-2855",
      "sha256": "fd3fb69d6ea2ed0c220eba1d4479c0b79d8713b39a28c62cc4bf1428491e8ebd",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/parser/parse_clause.c#L2851-L2855"
    },
    {
      "id": "src.call.42P20.ae80656ed795057fab150a08",
      "kind": "upstream_source",
      "source_role": "source_call",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "src/backend/parser/parse_clause.c",
      "location": "lines 2863-2867",
      "sha256": "fd3fb69d6ea2ed0c220eba1d4479c0b79d8713b39a28c62cc4bf1428491e8ebd",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/parser/parse_clause.c#L2863-L2867"
    },
    {
      "id": "src.call.42P20.51b9fa13c98768648a42bec3",
      "kind": "upstream_source",
      "source_role": "source_call",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "src/backend/parser/parse_clause.c",
      "location": "lines 2893-2897",
      "sha256": "fd3fb69d6ea2ed0c220eba1d4479c0b79d8713b39a28c62cc4bf1428491e8ebd",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/parser/parse_clause.c#L2893-L2897"
    },
    {
      "id": "src.call.42P20.879f1f1e1a0b390154b2b059",
      "kind": "upstream_source",
      "source_role": "source_call",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "src/backend/parser/parse_clause.c",
      "location": "lines 2899-2904",
      "sha256": "fd3fb69d6ea2ed0c220eba1d4479c0b79d8713b39a28c62cc4bf1428491e8ebd",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/parser/parse_clause.c#L2899-L2904"
    },
    {
      "id": "src.call.42P20.faf4767dd0e2b75c0c2f5763",
      "kind": "upstream_source",
      "source_role": "source_call",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "src/backend/parser/parse_clause.c",
      "location": "lines 2921-2924",
      "sha256": "fd3fb69d6ea2ed0c220eba1d4479c0b79d8713b39a28c62cc4bf1428491e8ebd",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/parser/parse_clause.c#L2921-L2924"
    },
    {
      "id": "src.call.42P20.745a6ce52598aa006a4c0b9d",
      "kind": "upstream_source",
      "source_role": "source_call",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "src/backend/parser/parse_clause.c",
      "location": "lines 2944-2947",
      "sha256": "fd3fb69d6ea2ed0c220eba1d4479c0b79d8713b39a28c62cc4bf1428491e8ebd",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/parser/parse_clause.c#L2944-L2947"
    },
    {
      "id": "src.context.42P20.nodeWindowAgg",
      "kind": "upstream_source",
      "source_role": "source_context",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "src/backend/executor/nodeWindowAgg.c",
      "location": "lines 2139-2210",
      "sha256": "c365e6750bc77a89562254903d099c3e5914e001d3aae418322ccffc1d535d17",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/executor/nodeWindowAgg.c#L2139"
    },
    {
      "id": "src.calls.REL_18_6.42P20",
      "kind": "local_artifact",
      "source_role": "source_call_scan",
      "sha256": "9ee8a0e81d8f0825c5c1ae45583439859a26e602bdd4ce2f2a62aa278867ccbf"
    }
  ],
  "claims": [
    {
      "id": "identity.class-and-condition",
      "statement": "42P20 is the windowing_error condition in Class 42.",
      "method": "Read fixed REL_18_6 errcodes.txt and locked facts.",
      "limits": "Identity does not enumerate all source branches or client failures.",
      "sources": [
        "src.errcodes.42P20.18.6"
      ]
    },
    {
      "id": "mechanism.selected-source-path",
      "statement": "Selected fixed 18.6 parser, parse-analysis, named-window, and executor paths reject invalid frame bounds, forbidden window placement or nesting, and illegal window inheritance. The parser also guards RANGE offset and GROUPS structural requirements.",
      "method": "Read complete fixed-source contexts around the selected report groups and the frame-offset executor guard.",
      "limits": "Representative confirmed core paths only; not exhaustive historical or extension coverage. A legal frame can still evaluate to no rows for a particular row.",
      "sources": [
        "src.call.42P20.17809e6b7f525d4ed41961ed",
        "src.call.42P20.5670c88a2f3e05b693257e49",
        "src.call.42P20.ed2f8bce483ee7cc9c9ff7e0",
        "src.call.42P20.af44057d6b02e78ceb659ea3",
        "src.call.42P20.05acd1c626dd243023930f4b",
        "src.call.42P20.2b557a2b5c702ff1eeb57eaa",
        "src.call.42P20.fde5045d9190c4d041b74444",
        "src.call.42P20.4d72e034c551705933ff1342",
        "src.call.42P20.0221c1569253594c6c3f8117",
        "src.call.42P20.ae80656ed795057fab150a08",
        "src.call.42P20.51b9fa13c98768648a42bec3",
        "src.call.42P20.879f1f1e1a0b390154b2b059",
        "src.call.42P20.faf4767dd0e2b75c0c2f5763",
        "src.call.42P20.745a6ce52598aa006a4c0b9d",
        "src.context.42P20.nodeWindowAgg"
      ]
    },
    {
      "id": "boundary.negative-offset-code",
      "statement": "The 18.6 executor assigns negative ROWS or GROUPS frame offsets to 22013 invalid_preceding_or_following_size and NULL frame offsets to 22004 null_value_not_allowed; these boundaries are separate from 42P20.",
      "method": "Read nodeWindowAgg.c calculate_frame_offsets and the fixed error-code catalogue.",
      "limits": "Boundary only; no natural runtime execution is claimed.",
      "sources": [
        "src.context.42P20.nodeWindowAgg"
      ]
    },
    {
      "id": "versions.catalogue-boundary",
      "statement": "Locked catalogue snapshots show this condition by PostgreSQL 8.4.0; source behavior here is fixed at PostgreSQL 18.6.",
      "method": "Read locked catalogue facts and definition snapshot.",
      "limits": "First observed release is a lower bound, not precise behavioral introduction.",
      "sources": [
        "src.errcodes.42P20.18.6"
      ]
    }
  ],
  "messages": [
    {
      "id": "message.variant-1",
      "sqlstate": "42P20",
      "severity_source": "ERROR",
      "primary_template": "window function calls cannot be nested",
      "detail_templates": [],
      "hint_templates": [],
      "roles": [
        {
          "role": "errmsg",
          "template": "window function calls cannot be nested"
        }
      ],
      "sources": [
        "src.call.42P20.17809e6b7f525d4ed41961ed"
      ],
      "limits": "Placeholders remain dynamic source fields; no concrete runtime value is claimed."
    },
    {
      "id": "message.variant-2",
      "sqlstate": "42P20",
      "severity_source": "ERROR",
      "primary_template": "frame start cannot be UNBOUNDED FOLLOWING",
      "detail_templates": [],
      "hint_templates": [],
      "roles": [
        {
          "role": "errmsg",
          "template": "frame start cannot be UNBOUNDED FOLLOWING"
        }
      ],
      "sources": [
        "src.call.42P20.5670c88a2f3e05b693257e49"
      ],
      "limits": "Placeholders remain dynamic source fields; no concrete runtime value is claimed."
    },
    {
      "id": "message.variant-3",
      "sqlstate": "42P20",
      "severity_source": "ERROR",
      "primary_template": "frame starting from following row cannot end with current row",
      "detail_templates": [],
      "hint_templates": [],
      "roles": [
        {
          "role": "errmsg",
          "template": "frame starting from following row cannot end with current row"
        }
      ],
      "sources": [
        "src.call.42P20.ed2f8bce483ee7cc9c9ff7e0"
      ],
      "limits": "Placeholders remain dynamic source fields; no concrete runtime value is claimed."
    },
    {
      "id": "message.variant-4",
      "sqlstate": "42P20",
      "severity_source": "ERROR",
      "primary_template": "frame end cannot be UNBOUNDED PRECEDING",
      "detail_templates": [],
      "hint_templates": [],
      "roles": [
        {
          "role": "errmsg",
          "template": "frame end cannot be UNBOUNDED PRECEDING"
        }
      ],
      "sources": [
        "src.call.42P20.af44057d6b02e78ceb659ea3"
      ],
      "limits": "Placeholders remain dynamic source fields; no concrete runtime value is claimed."
    },
    {
      "id": "message.variant-5",
      "sqlstate": "42P20",
      "severity_source": "ERROR",
      "primary_template": "frame starting from current row cannot have preceding rows",
      "detail_templates": [],
      "hint_templates": [],
      "roles": [
        {
          "role": "errmsg",
          "template": "frame starting from current row cannot have preceding rows"
        }
      ],
      "sources": [
        "src.call.42P20.05acd1c626dd243023930f4b"
      ],
      "limits": "Placeholders remain dynamic source fields; no concrete runtime value is claimed."
    },
    {
      "id": "message.variant-6",
      "sqlstate": "42P20",
      "severity_source": "ERROR",
      "primary_template": "frame starting from following row cannot have preceding rows",
      "detail_templates": [],
      "hint_templates": [],
      "roles": [
        {
          "role": "errmsg",
          "template": "frame starting from following row cannot have preceding rows"
        }
      ],
      "sources": [
        "src.call.42P20.2b557a2b5c702ff1eeb57eaa"
      ],
      "limits": "Placeholders remain dynamic source fields; no concrete runtime value is claimed."
    },
    {
      "id": "message.variant-7",
      "sqlstate": "42P20",
      "severity_source": "ERROR",
      "primary_template": "window functions are not allowed in %s",
      "detail_templates": [],
      "hint_templates": [],
      "roles": [
        {
          "role": "errmsg",
          "template": "window functions are not allowed in %s"
        }
      ],
      "sources": [
        "src.call.42P20.fde5045d9190c4d041b74444"
      ],
      "limits": "Placeholders remain dynamic source fields; no concrete runtime value is claimed."
    },
    {
      "id": "message.variant-8",
      "sqlstate": "42P20",
      "severity_source": "ERROR",
      "primary_template": "window \"%s\" is already defined",
      "detail_templates": [],
      "hint_templates": [],
      "roles": [
        {
          "role": "errmsg",
          "template": "window \"%s\" is already defined"
        }
      ],
      "sources": [
        "src.call.42P20.4d72e034c551705933ff1342"
      ],
      "limits": "Placeholders remain dynamic source fields; no concrete runtime value is claimed."
    },
    {
      "id": "message.variant-9",
      "sqlstate": "42P20",
      "severity_source": "ERROR",
      "primary_template": "cannot override PARTITION BY clause of window \"%s\"",
      "detail_templates": [],
      "hint_templates": [],
      "roles": [
        {
          "role": "errmsg",
          "template": "cannot override PARTITION BY clause of window \"%s\""
        }
      ],
      "sources": [
        "src.call.42P20.0221c1569253594c6c3f8117"
      ],
      "limits": "Placeholders remain dynamic source fields; no concrete runtime value is claimed."
    },
    {
      "id": "message.variant-10",
      "sqlstate": "42P20",
      "severity_source": "ERROR",
      "primary_template": "cannot override ORDER BY clause of window \"%s\"",
      "detail_templates": [],
      "hint_templates": [],
      "roles": [
        {
          "role": "errmsg",
          "template": "cannot override ORDER BY clause of window \"%s\""
        }
      ],
      "sources": [
        "src.call.42P20.ae80656ed795057fab150a08"
      ],
      "limits": "Placeholders remain dynamic source fields; no concrete runtime value is claimed."
    },
    {
      "id": "message.variant-11",
      "sqlstate": "42P20",
      "severity_source": "ERROR",
      "primary_template": "cannot copy window \"%s\" because it has a frame clause",
      "detail_templates": [],
      "hint_templates": [],
      "roles": [
        {
          "role": "errmsg",
          "template": "cannot copy window \"%s\" because it has a frame clause"
        }
      ],
      "sources": [
        "src.call.42P20.51b9fa13c98768648a42bec3"
      ],
      "limits": "Placeholders remain dynamic source fields; no concrete runtime value is claimed."
    },
    {
      "id": "message.variant-12",
      "sqlstate": "42P20",
      "severity_source": "ERROR",
      "primary_template": "cannot copy window \"%s\" because it has a frame clause",
      "detail_templates": [],
      "hint_templates": [
        "Omit the parentheses in this OVER clause."
      ],
      "roles": [
        {
          "role": "errmsg",
          "template": "cannot copy window \"%s\" because it has a frame clause"
        },
        {
          "role": "errhint",
          "template": "Omit the parentheses in this OVER clause."
        }
      ],
      "sources": [
        "src.call.42P20.879f1f1e1a0b390154b2b059"
      ],
      "limits": "Placeholders remain dynamic source fields; no concrete runtime value is claimed."
    },
    {
      "id": "message.variant-13",
      "sqlstate": "42P20",
      "severity_source": "ERROR",
      "primary_template": "RANGE with offset PRECEDING/FOLLOWING requires exactly one ORDER BY column",
      "detail_templates": [],
      "hint_templates": [],
      "roles": [
        {
          "role": "errmsg",
          "template": "RANGE with offset PRECEDING/FOLLOWING requires exactly one ORDER BY column"
        }
      ],
      "sources": [
        "src.call.42P20.faf4767dd0e2b75c0c2f5763"
      ],
      "limits": "Placeholders remain dynamic source fields; no concrete runtime value is claimed."
    },
    {
      "id": "message.variant-14",
      "sqlstate": "42P20",
      "severity_source": "ERROR",
      "primary_template": "GROUPS mode requires an ORDER BY clause",
      "detail_templates": [],
      "hint_templates": [],
      "roles": [
        {
          "role": "errmsg",
          "template": "GROUPS mode requires an ORDER BY clause"
        }
      ],
      "sources": [
        "src.call.42P20.745a6ce52598aa006a4c0b9d"
      ],
      "limits": "Placeholders remain dynamic source fields; no concrete runtime value is claimed."
    }
  ],
  "usage_evidence": [
    {
      "scope": "SQLSTATE definition and release identity",
      "status": "definition_only",
      "evidence_ids": [
        "identity.class-and-condition",
        "src.errcodes.42P20.18.6"
      ]
    },
    {
      "scope": "Selected PostgreSQL 18.6 source emitters and message roles",
      "status": "source_path_confirmed",
      "evidence_ids": [
        "mechanism.selected-source-path"
      ]
    },
    {
      "scope": "Natural runtime execution for this batch",
      "status": "unknown",
      "evidence_ids": []
    }
  ],
  "runtime": []
}
