{
  "schema": 1,
  "sqlstate": "2200H",
  "condition_name": "sequence_generator_limit_exceeded",
  "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#L198",
      "lines": "198"
    },
    {
      "id": "src.calls.REL_18_6",
      "kind": "local_artifact",
      "source_role": "source_call_scan",
      "sha256": "9ee8a0e81d8f0825c5c1ae45583439859a26e602bdd4ce2f2a62aa278867ccbf"
    },
    {
      "id": "src.path.sequence-limit",
      "kind": "upstream_source",
      "source_role": "source_guard",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "src/backend/commands/sequence.c",
      "sha256": "3e5afe17d5a84862fae502a5481211220368f1d639e9d07ba6f96ee8be92a8d8",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/commands/sequence.c#L731-L769",
      "lines": "731-769"
    }
  ],
  "claims": [
    {
      "id": "identity",
      "statement": "2200H is sequence_generator_limit_exceeded in SQLSTATE Class 22.",
      "sources": [
        "src.errcodes.18.6"
      ],
      "method": "Read fixed definition."
    },
    {
      "id": "mechanism.sequence-limit",
      "statement": "The nextval fetch loop checks the configured maximum for ascending sequences and minimum for descending sequences; at a boundary, rescnt > 0 stops fetching so already fetched legal values can be returned, while a non-cycling branch with no result left emits 2200H and cycle=true wraps to the opposite bound.",
      "sources": [
        "src.path.sequence-limit"
      ],
      "method": "Read the full fetch loop and both boundary branches.",
      "limits": "The endpoint value can be a legal returned value, and CYCLE is a sequence policy choice rather than a universal repair for exhausted identifiers."
    },
    {
      "id": "history",
      "statement": "The locked catalogue records 2200H from 10.0 without proving an exact implementation introduction date.",
      "sources": [
        "src.errcodes.18.6"
      ],
      "method": "Use catalogue boundary."
    }
  ],
  "messages": [
    {
      "id": "message.sequence-max",
      "sqlstate": "2200H",
      "primary_template": "nextval: reached maximum value of sequence \"%s\" (%\" PRId64 \")",
      "severity_source": "ERROR",
      "sources": [
        "src.path.sequence-limit"
      ]
    },
    {
      "id": "message.sequence-min",
      "sqlstate": "2200H",
      "primary_template": "nextval: reached minimum value of sequence \"%s\" (%\" PRId64 \")",
      "severity_source": "ERROR",
      "sources": [
        "src.path.sequence-limit"
      ]
    }
  ],
  "usage_evidence": [
    {
      "scope": "definition",
      "status": "definition_only",
      "evidence_ids": [
        "identity"
      ]
    },
    {
      "scope": "fixed-source-path",
      "status": "source_path_confirmed",
      "evidence_ids": [
        "mechanism.sequence-limit"
      ]
    },
    {
      "scope": "history",
      "status": "unknown",
      "evidence_ids": [
        "history"
      ]
    },
    {
      "scope": "natural-runtime",
      "status": "unknown",
      "evidence_ids": [
        "mechanism.sequence-limit"
      ]
    }
  ],
  "runtime": []
}
