{
  "schema": 1,
  "sqlstate": "54001",
  "condition_name": "statement_too_complex",
  "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#L417",
      "lines": "417"
    },
    {
      "id": "src.path.0",
      "kind": "upstream_source",
      "source_role": "resolved_report_context",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "src/backend/parser/parse_agg.c",
      "sha256": "6e80a805fddbfc9c7e0f3047b348bf992a20c99f16ce7fee89c7067753027f72",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/parser/parse_agg.c#L1166",
      "lines": "1166-1172"
    },
    {
      "id": "src.path.1",
      "kind": "upstream_source",
      "source_role": "resolved_report_context",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "src/backend/utils/misc/stack_depth.c",
      "sha256": "ed87e94a4f73600983230aca3a4c1869d3b9cbb7c83ec36a6bbd7e403925e920",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/misc/stack_depth.c#L100",
      "lines": "100-105"
    },
    {
      "id": "src.path.2",
      "kind": "upstream_source",
      "source_role": "resolved_report_context",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "src/backend/utils/misc/stack_depth.c",
      "sha256": "ed87e94a4f73600983230aca3a4c1869d3b9cbb7c83ec36a6bbd7e403925e920",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/misc/stack_depth.c#L156",
      "lines": "156-168"
    }
  ],
  "claims": [
    {
      "id": "identity",
      "statement": "54001 is statement_too_complex in SQLSTATE Class 54.",
      "sources": [
        "src.errcodes.18.6"
      ],
      "method": "Read fixed definition."
    },
    {
      "id": "resolved-paths",
      "statement": "The cited PostgreSQL 18.6 source paths support the representative resource and object-state mechanisms described.",
      "sources": [
        "src.path.0",
        "src.path.1",
        "src.path.2"
      ],
      "method": "Read complete fixed source contexts.",
      "limits": "Source confirmation is not natural runtime."
    },
    {
      "id": "stack-platform-guard",
      "statement": "The max_stack_depth GUC check rejects a value above the platform stack rlimit and points to increasing the platform limit, while recursive checks emit 54001 before stack overflow.",
      "sources": [
        "src.path.1",
        "src.path.2"
      ],
      "method": "Read the complete stack-depth error and GUC check hooks."
    },
    {
      "id": "history",
      "statement": "The locked catalogue records 54001 from 7.4; that boundary does not prove exact implementation introduction.",
      "sources": [
        "src.errcodes.18.6"
      ],
      "method": "Use catalogue boundary."
    }
  ],
  "messages": [
    {
      "id": "message.0",
      "sqlstate": "54001",
      "primary_template": "too many grouping sets present (maximum 4096)",
      "severity_source": "ERROR",
      "sources": [
        "src.path.0"
      ]
    },
    {
      "id": "message.1",
      "sqlstate": "54001",
      "primary_template": "stack depth limit exceeded",
      "severity_source": "ERROR",
      "sources": [
        "src.path.1"
      ],
      "hint_template": "Increase the configuration parameter \"max_stack_depth\" (currently %dkB), after ensuring the platform stack depth limit is adequate."
    }
  ],
  "usage_evidence": [
    {
      "scope": "definition",
      "status": "definition_only",
      "evidence_ids": [
        "identity"
      ]
    },
    {
      "scope": "fixed-source-path",
      "status": "source_path_confirmed",
      "evidence_ids": [
        "resolved-paths",
        "stack-platform-guard"
      ]
    },
    {
      "scope": "history",
      "status": "unknown",
      "evidence_ids": [
        "history"
      ]
    },
    {
      "scope": "natural-runtime",
      "status": "unknown",
      "evidence_ids": [
        "resolved-paths"
      ]
    }
  ],
  "runtime": []
}
