{
  "schema": 1,
  "sqlstate": "23514",
  "condition_name": "check_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.execMain.18.6",
      "kind": "upstream_source",
      "source_role": "source_path",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "src/backend/executor/execMain.c",
      "sha256": "33b97337fa23a649c5e7a092e1bd405a54e8503529236c62c9d5bb93a1774a8d",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/executor/execMain.c#L2076-L2081"
    },
    {
      "id": "src.tablecmds.18.6",
      "kind": "upstream_source",
      "source_role": "source_path",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "src/backend/commands/tablecmds.c",
      "sha256": "422dc8e833df4940755973c757e338295822ba3e4c7266c40669f49f96eb15a9",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/commands/tablecmds.c#L6502-L6532"
    },
    {
      "id": "doc.ddl-constraints.18.6",
      "kind": "upstream_source",
      "source_role": "official_documentation",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "doc/src/sgml/ddl.sgml",
      "sha256": "ce1919d9236f2e71672660e1a347146472e966e4d19b77fde5ae345dd1db6ec7",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/ddl.sgml",
      "docs_url": "https://www.postgresql.org/docs/18/ddl-constraints.html"
    },
    {
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "id": "src.execPartition.18.6",
      "kind": "upstream_source",
      "path": "src/backend/executor/execPartition.c",
      "sha256": "97951428f673d4eb6dd23141817874c29640aaac0d6dc74015c993cbd0636dd6",
      "source_role": "source_path",
      "tag": "REL_18_6",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/executor/execPartition.c#L328-L335"
    },
    {
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "id": "src.typecmds.18.6",
      "kind": "upstream_source",
      "path": "src/backend/commands/typecmds.c",
      "sha256": "60d1e9754646e100f6b74aa367ad8c2c52386c400df721707423d329209c47eb",
      "source_role": "source_path",
      "tag": "REL_18_6",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/commands/typecmds.c#L3288-L3293"
    },
    {
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "id": "src.execIndexing.18.6",
      "kind": "upstream_source",
      "path": "src/backend/executor/execIndexing.c",
      "sha256": "24c80553ab4b28d7d2a288dd9196c8db9459c7f308853cd8c8c939485e15f199",
      "source_role": "source_path",
      "tag": "REL_18_6",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/executor/execIndexing.c#L1176-L1181"
    }
  ],
  "claims": [
    {
      "id": "identity",
      "statement": "23514 is check_violation in Class 23.",
      "sources": [
        "src.errcodes.18.6"
      ],
      "method": "Read the fixed errcodes row.",
      "limits": "It denotes a failed CHECK or related partition/default constraint path, not only a named table CHECK."
    },
    {
      "id": "row-path",
      "statement": "The executor reports 23514 with the relation and failed CHECK name when a row evaluates to false.",
      "sources": [
        "src.execMain.18.6",
        "src.calls.REL_18_6"
      ],
      "method": "Trace the executor report group and errtableconstraint metadata.",
      "limits": "A CHECK expression that evaluates to NULL is accepted by PostgreSQL; use NOT NULL when NULL itself is invalid."
    },
    {
      "id": "schema-path",
      "statement": "Constraint validation, partition routing, and domain checks can produce different 23514 templates.",
      "sources": [
        "src.tablecmds.18.6",
        "src.calls.REL_18_6",
        "src.execPartition.18.6",
        "src.typecmds.18.6",
        "src.execIndexing.18.6"
      ],
      "method": "Compare the fixed source call groups.",
      "limits": "Repairing data may require a migration or a different partition route; do not assume every 23514 is a duplicate or syntax problem."
    },
    {
      "id": "runtime",
      "statement": "The selected named CHECK case returned 23514 on PG18.6 and PG10.21, identified amount_positive/items, stayed IDLE, and committed a valid row.",
      "sources": [
        "runtime.23514-batch1-latest-20260909.latest",
        "runtime.23514-batch1-pg10-20260909.pg10"
      ],
      "method": "Read the selected summaries and raw diagnostics.",
      "limits": "The case does not cover deferred checks, partition routing, domain checks, or validation-time errors."
    }
  ],
  "messages": [
    {
      "id": "row",
      "sqlstate": "23514",
      "primary_template": "new row for relation \"%s\" violates check constraint \"%s\"",
      "severity_source": "ERROR",
      "sources": [
        "src.execMain.18.6"
      ],
      "limits": "The failing-row detail is conditional and can be suppressed by context or configuration.",
      "detail_template": "Failing row contains %s."
    },
    {
      "id": "partition-no-route",
      "limits": "The partition-key substitution is dynamically built; the path is not the named CHECK template.",
      "primary_template": "no partition of relation \"%s\" found for row",
      "detail_template": "Partition key of the failing row contains %s.",
      "severity_source": "ERROR",
      "sources": [
        "src.execPartition.18.6"
      ],
      "sqlstate": "23514"
    },
    {
      "id": "partition-constraint",
      "limits": "The relation and failing-row description are dynamic.",
      "primary_template": "new row for relation \"%s\" violates partition constraint",
      "detail_template": "Failing row contains %s.",
      "severity_source": "ERROR",
      "sources": [
        "src.execMain.18.6"
      ],
      "sqlstate": "23514"
    },
    {
      "id": "domain-validation",
      "limits": "The column and table identify the existing domain use; this is validation of a new domain constraint.",
      "primary_template": "column \"%s\" of table \"%s\" contains values that violate the new constraint",
      "severity_source": "ERROR",
      "sources": [
        "src.typecmds.18.6"
      ],
      "sqlstate": "23514"
    },
    {
      "id": "without-overlaps-empty",
      "limits": "The column and relation are dynamic; this is the empty-value guard, distinct from a conflict with an existing key.",
      "primary_template": "empty WITHOUT OVERLAPS value found in column \"%s\" in relation \"%s\"",
      "severity_source": "ERROR",
      "sources": [
        "src.execIndexing.18.6"
      ],
      "sqlstate": "23514"
    }
  ],
  "usage_evidence": [
    {
      "scope": "named-check-runtime",
      "status": "observed_runtime",
      "evidence_ids": [
        "runtime",
        "runtime.23514-batch1-latest-20260909.latest",
        "runtime.23514-batch1-pg10-20260909.pg10"
      ]
    },
    {
      "scope": "source-paths",
      "status": "source_path_confirmed",
      "evidence_ids": [
        "identity",
        "row-path",
        "schema-path"
      ]
    }
  ],
  "runtime": [
    {
      "id": "runtime.23514-batch1-latest-20260909.latest",
      "run_id": "23514-batch1-latest-20260909",
      "target": "latest",
      "server_version": "18.6 (Homebrew)",
      "server_version_num": 180006,
      "status": "passed",
      "cases": [
        "check_constraint_insert"
      ],
      "summary_sha256": "ea15d7fcfc868444fd08a27f5a428e75f5d129e53732fa0ac19449bcc0e589a4",
      "raw_sha256": "11302e6a32ae75c2f4938099bcbcfeeb774ad58e3f404574c56b0c81ea828012",
      "snippet_registry": {
        "sha256": "0dcd48b5f9b3c4264c7843f77edae204d2a37b55a2b41bb2570febfdf6391d83"
      },
      "case_manifest": {
        "sha256": "86b43f2a10da9ff67b7b53b05fe3d16121b922f713be9f02f7c8caf558f73012"
      },
      "observed": {
        "sqlstate": "23514",
        "primary": "new row for relation \"items\" violates check constraint \"amount_positive\"",
        "detail": "Failing row contains (2, -1).",
        "constraint": "amount_positive",
        "table": "items",
        "status_after_error": "IDLE",
        "rows": [
          [
            1,
            10
          ],
          [
            2,
            1
          ]
        ]
      }
    },
    {
      "id": "runtime.23514-batch1-pg10-20260909.pg10",
      "run_id": "23514-batch1-pg10-20260909",
      "target": "pg10",
      "server_version": "10.21 (Debian 10.21-1.pgdg90+1)",
      "server_version_num": 100021,
      "status": "passed",
      "cases": [
        "check_constraint_insert"
      ],
      "summary_sha256": "599d10014ead75a34e9a0f59a7485ba0cdbfc350fa01456201c8bda00b29aa10",
      "raw_sha256": "e0a09ba6b64cc6ba16b2038fb8fee8541d55b047369068ccca8b2406c5700699",
      "snippet_registry": {
        "sha256": "0dcd48b5f9b3c4264c7843f77edae204d2a37b55a2b41bb2570febfdf6391d83"
      },
      "case_manifest": {
        "sha256": "86b43f2a10da9ff67b7b53b05fe3d16121b922f713be9f02f7c8caf558f73012"
      },
      "observed": {
        "sqlstate": "23514",
        "primary": "new row for relation \"items\" violates check constraint \"amount_positive\"",
        "detail": "Failing row contains (2, -1).",
        "constraint": "amount_positive",
        "table": "items",
        "status_after_error": "IDLE",
        "rows": [
          [
            1,
            10
          ],
          [
            2,
            1
          ]
        ]
      }
    }
  ]
}
