{
  "schema": 1,
  "sqlstate": "2202H",
  "condition_name": "invalid_tablesample_argument",
  "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#L190",
      "lines": "190"
    },
    {
      "id": "src.path.0",
      "kind": "upstream_source",
      "source_role": "resolved_report_context",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "src/backend/access/tablesample/bernoulli.c",
      "sha256": "19ab17ceb139db5fbf8ae210b1933bd9632a11cf1307b21228228fa9578d5dce",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/access/tablesample/bernoulli.c#L146",
      "lines": "146-148"
    },
    {
      "id": "src.nodeSamplescan.argument",
      "kind": "upstream_source",
      "source_role": "resolved_report_context",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "src/backend/executor/nodeSamplescan.c",
      "sha256": "59ddce276a131990661664393bf645d62693a722f382bd040f6b1c2584e7b2a5",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/executor/nodeSamplescan.c#L232",
      "lines": "232-245"
    },
    {
      "id": "src.system.tablesample",
      "kind": "upstream_source",
      "source_role": "resolved_report_context",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "src/backend/access/tablesample/system.c",
      "sha256": "68775686cd9e9c9bc4bcb34bad5ff8fa3993aea3b7db56ecacd07251e42aada5",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/access/tablesample/system.c#L140",
      "lines": "140-152"
    },
    {
      "id": "src.system_rows.tablesample",
      "kind": "upstream_source",
      "source_role": "resolved_report_context",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "contrib/tsm_system_rows/tsm_system_rows.c",
      "sha256": "192b921607c93979a09625f9d54d583d6f2e8ee8566aeb8cc09152271d04066c",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/contrib/tsm_system_rows/tsm_system_rows.c#L178",
      "lines": "178-187"
    },
    {
      "id": "src.system_time.tablesample",
      "kind": "upstream_source",
      "source_role": "resolved_report_context",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "contrib/tsm_system_time/tsm_system_time.c",
      "sha256": "c3dc4faa00302e4bb993a468f7c62612da3db97cf85152c4cb3fe5b5d18d89c9",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/contrib/tsm_system_time/tsm_system_time.c#L193",
      "lines": "193-203"
    }
  ],
  "claims": [
    {
      "id": "identity",
      "statement": "2202H is invalid_tablesample_argument in SQLSTATE Class 22.",
      "sources": [
        "src.errcodes.18.6"
      ],
      "method": "Read fixed definition."
    },
    {
      "id": "resolved-path",
      "statement": "Fixed core and contrib TABLESAMPLE methods share 2202H for method-argument validation: Bernoulli/system reject percentages outside 0..100 and NaN, the executor rejects a NULL method parameter, system_rows rejects negative size, and system_time rejects negative or NaN collection time. The shown system_time guard does not impose a finite upper bound, so positive Infinity is not rejected by that comparison itself.",
      "sources": [
        "src.path.0",
        "src.nodeSamplescan.argument",
        "src.system.tablesample",
        "src.system_rows.tablesample",
        "src.system_time.tablesample"
      ],
      "method": "Read the executor parameter loop and complete core/contrib BeginSampleScan guards.",
      "limits": "Source confirmation is not a natural runtime observation."
    },
    {
      "id": "history",
      "statement": "The locked catalogue records 2202H from 9.5.0 without proving exact implementation introduction.",
      "sources": [
        "src.errcodes.18.6"
      ],
      "method": "Use catalogue boundary."
    }
  ],
  "messages": [
    {
      "id": "message.0",
      "sqlstate": "2202H",
      "primary_template": "sample percentage must be between 0 and 100",
      "severity_source": "ERROR",
      "sources": [
        "src.path.0"
      ]
    },
    {
      "id": "message.parameter-null",
      "sqlstate": "2202H",
      "primary_template": "TABLESAMPLE parameter cannot be null",
      "severity_source": "ERROR",
      "sources": [
        "src.nodeSamplescan.argument"
      ]
    },
    {
      "id": "message.sample-percentage",
      "sqlstate": "2202H",
      "primary_template": "sample percentage must be between 0 and 100",
      "severity_source": "ERROR",
      "sources": [
        "src.path.0"
      ]
    },
    {
      "id": "message.sample-size",
      "sqlstate": "2202H",
      "primary_template": "sample size must not be negative",
      "severity_source": "ERROR",
      "sources": [
        "src.system_rows.tablesample"
      ]
    },
    {
      "id": "message.sample-time",
      "sqlstate": "2202H",
      "primary_template": "sample collection time must not be negative",
      "severity_source": "ERROR",
      "sources": [
        "src.system_time.tablesample"
      ]
    }
  ],
  "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": []
}
