{
  "schema": 1,
  "sqlstate": "23P01",
  "condition_name": "exclusion_violation",
  "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"
    },
    {
      "id": "src.calls.REL_18_6",
      "kind": "local_artifact",
      "source_role": "source_call_scan",
      "sha256": "9ee8a0e81d8f0825c5c1ae45583439859a26e602bdd4ce2f2a62aa278867ccbf"
    },
    {
      "id": "src.execIndexing.18.6",
      "kind": "upstream_source",
      "source_role": "source_path",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "src/backend/executor/execIndexing.c",
      "sha256": "24c80553ab4b28d7d2a288dd9196c8db9459c7f308853cd8c8c939485e15f199",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/executor/execIndexing.c#L917-L937"
    },
    {
      "id": "doc.rangetypes.18.6",
      "kind": "upstream_source",
      "source_role": "official_documentation",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "doc/src/sgml/rangetypes.sgml",
      "sha256": "cfeffb134d2acc2ec45141726583b041410665c4a2f8ecf66cd3f9484a7f0014",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/rangetypes.sgml#L540-L573",
      "docs_url": "https://www.postgresql.org/docs/18/rangetypes.html#RANGETYPES-CONSTRAINT"
    }
  ],
  "claims": [
    {
      "id": "identity",
      "statement": "23P01 is exclusion_violation in Class 23.",
      "sources": [
        "src.errcodes.18.6"
      ],
      "method": "Read the fixed errcodes row.",
      "limits": "The exclusion operator may compare more than equality; the operator class and constraint definition determine the conflict."
    },
    {
      "id": "mechanism",
      "statement": "An exclusion constraint rejects a row when the configured operator comparisons are all true against an existing row; the range example uses && for overlap.",
      "sources": [
        "src.execIndexing.18.6",
        "doc.rangetypes.18.6",
        "src.calls.REL_18_6"
      ],
      "method": "Trace check_exclusion_or_unique_constraint and the range exclusion documentation.",
      "limits": "A half-open range [10,12) does not overlap [1,10); changing bounds is a business rule, not a blanket retry."
    },
    {
      "id": "runtime",
      "statement": "The selected immediate GiST range case returned 23P01 on PG18.6 and PG10.21, identified bookings_no_overlap, stayed IDLE, and committed a non-overlapping [10,12) range.",
      "sources": [
        "runtime.23P01-batch1-latest-20260909.latest",
        "runtime.23P01-batch1-pg10-20260909.pg10"
      ],
      "method": "Read the selected summaries and raw diagnostics.",
      "limits": "This case does not test DEFERRABLE exclusion constraints, concurrent waits, or every operator class."
    }
  ],
  "messages": [
    {
      "id": "conflict",
      "sqlstate": "23P01",
      "primary_template": "conflicting key value violates exclusion constraint \"%s\"",
      "severity_source": "ERROR",
      "sources": [
        "src.execIndexing.18.6"
      ],
      "limits": "The detail is dynamically built from the conflicting key values; the fallback is “Key conflicts with existing key.”",
      "detail_template": "Key %s conflicts with existing key %s."
    }
  ],
  "usage_evidence": [
    {
      "scope": "range-exclusion-runtime",
      "status": "observed_runtime",
      "evidence_ids": [
        "runtime",
        "runtime.23P01-batch1-latest-20260909.latest",
        "runtime.23P01-batch1-pg10-20260909.pg10"
      ]
    },
    {
      "scope": "source-path",
      "status": "source_path_confirmed",
      "evidence_ids": [
        "identity",
        "mechanism"
      ]
    }
  ],
  "runtime": [
    {
      "id": "runtime.23P01-batch1-latest-20260909.latest",
      "run_id": "23P01-batch1-latest-20260909",
      "target": "latest",
      "server_version": "18.6 (Homebrew)",
      "server_version_num": 180006,
      "status": "passed",
      "cases": [
        "overlapping_range_exclusion"
      ],
      "summary_sha256": "5e613eec8134801dfb3a603e7926418ee5d73b585546fd1aaa9004eeec553ef4",
      "raw_sha256": "b4e9ebe13743c12d84be1113ebdcec01c12ae79368e9b85b4ff1e01179dc7880",
      "snippet_registry": {
        "sha256": "475f58dda688a5864436d67e18f16abfbfae0b178acecaabe66ebaca7ab3c585"
      },
      "case_manifest": {
        "sha256": "6dcb833ed64435a75016520f520cbb1abffc7d8751eb9195dc8ad5ffa2a9680e"
      },
      "observed": {
        "sqlstate": "23P01",
        "primary": "conflicting key value violates exclusion constraint \"bookings_no_overlap\"",
        "detail": "Key (during)=([5,12)) conflicts with existing key (during)=([1,10)).",
        "constraint": "bookings_no_overlap",
        "status_after_error": "IDLE",
        "rows": [
          [
            1,
            "[1,10)"
          ],
          [
            2,
            "[10,12)"
          ]
        ]
      }
    },
    {
      "id": "runtime.23P01-batch1-pg10-20260909.pg10",
      "run_id": "23P01-batch1-pg10-20260909",
      "target": "pg10",
      "server_version": "10.21 (Debian 10.21-1.pgdg90+1)",
      "server_version_num": 100021,
      "status": "passed",
      "cases": [
        "overlapping_range_exclusion"
      ],
      "summary_sha256": "2b071d07ad5977b4fd9133f9815a92fc3fca27980659f26654b8dc3793abd767",
      "raw_sha256": "1975e9348838d73f3433c2da02a3f3972dc3670e24bc89d73d631cd35b219165",
      "snippet_registry": {
        "sha256": "475f58dda688a5864436d67e18f16abfbfae0b178acecaabe66ebaca7ab3c585"
      },
      "case_manifest": {
        "sha256": "6dcb833ed64435a75016520f520cbb1abffc7d8751eb9195dc8ad5ffa2a9680e"
      },
      "observed": {
        "sqlstate": "23P01",
        "primary": "conflicting key value violates exclusion constraint \"bookings_no_overlap\"",
        "detail": "Key (during)=([5,12)) conflicts with existing key (during)=([1,10)).",
        "constraint": "bookings_no_overlap",
        "status_after_error": "IDLE",
        "rows": [
          [
            1,
            "[1,10)"
          ],
          [
            2,
            "[10,12)"
          ]
        ]
      }
    }
  ]
}
