{
  "schema": 1,
  "sqlstate": "22001",
  "condition_name": "string_data_right_truncation",
  "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#L200",
      "lines": "200"
    },
    {
      "id": "src.calls.REL_18_6",
      "kind": "local_artifact",
      "source_role": "source_call_scan",
      "sha256": "9ee8a0e81d8f0825c5c1ae45583439859a26e602bdd4ce2f2a62aa278867ccbf"
    },
    {
      "id": "src.path.character",
      "kind": "upstream_source",
      "source_role": "source_guard",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "src/backend/utils/adt/varchar.c",
      "sha256": "aee29b2c745b34a7299d158b8e8c60b2c6c4900a5e3751fd211acea81b431f42",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/adt/varchar.c#L300-L313",
      "lines": "300-313"
    },
    {
      "id": "src.path.varchar",
      "kind": "upstream_source",
      "source_role": "source_guard",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "src/backend/utils/adt/varchar.c",
      "sha256": "aee29b2c745b34a7299d158b8e8c60b2c6c4900a5e3751fd211acea81b431f42",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/adt/varchar.c#L633-L640",
      "lines": "633-640"
    },
    {
      "id": "src.path.hstore",
      "kind": "upstream_source",
      "source_role": "source_guard",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "contrib/hstore/hstore_io.c",
      "sha256": "4f9e853ca79e1412d989e937749eeb2a251f7e8173d2732098e4c8a67a96b3d4",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/contrib/hstore/hstore_io.c#L407-L434",
      "lines": "407-434"
    },
    {
      "id": "src.path.varbit",
      "kind": "upstream_source",
      "source_role": "source_guard",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "src/backend/utils/adt/varbit.c",
      "sha256": "f719afe56683db3714a41d2f49f454a6b65b38e310c00d5afe47cbc44fd9480d",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/adt/varbit.c#L733-L758",
      "lines": "733-758"
    },
    {
      "id": "snippet-registry.22001",
      "kind": "local_artifact",
      "source_role": "runtime_input",
      "sha256": "ee3932e6fef2bd5b1c3ff35391019940f81eb61fd72854d9c79447efceeab634"
    }
  ],
  "claims": [
    {
      "id": "identity",
      "statement": "22001 is string_data_right_truncation in SQLSTATE Class 22.",
      "sources": [
        "src.errcodes.18.6"
      ],
      "method": "Read fixed definition."
    },
    {
      "id": "mechanism.character-varchar",
      "statement": "The character and character-varying input paths check the non-explicit value against the typmod and emit distinct primary templates; explicit casts may truncate according to the type rules.",
      "sources": [
        "src.path.character",
        "src.path.varchar"
      ],
      "method": "Read complete varchar.c width checks.",
      "limits": "The exact behavior depends on target type and explicitness."
    },
    {
      "id": "mechanism.extension-types",
      "statement": "hstore key/value and varbit length checks use 22001 with subsystem-specific messages.",
      "sources": [
        "src.path.hstore",
        "src.path.varbit"
      ],
      "method": "Read fixed extension/type guards.",
      "limits": "These are not interchangeable with varchar typmod diagnostics."
    },
    {
      "id": "history",
      "statement": "The locked catalogue records 22001 from 7.4 without proving an exact implementation introduction date.",
      "sources": [
        "src.errcodes.18.6"
      ],
      "method": "Use catalogue boundary."
    },
    {
      "id": "runtime.observation",
      "statement": "The varchar_width_overflow case passed on isolated PostgreSQL 18.6 and 10.21: the non-fitting varchar(3) value produced 22001, left the autocommit session IDLE, and the corrected value ok was accepted.",
      "sources": [
        "manifest.22001",
        "snippet-registry.22001"
      ],
      "method": "Execute the shared registry and inspect selected summaries.",
      "limits": "The observation covers varchar varying input only, not hstore, varbit, or explicit-cast truncation.",
      "runtime": [
        "runtime.22001-data1-latest.latest",
        "runtime.22001-data1-pg10.pg10"
      ]
    }
  ],
  "messages": [
    {
      "id": "message.character",
      "sqlstate": "22001",
      "primary_template": "value too long for type character(%d)",
      "severity_source": "ERROR",
      "sources": [
        "src.path.character"
      ]
    },
    {
      "id": "message.varchar",
      "sqlstate": "22001",
      "primary_template": "value too long for type character varying(%d)",
      "severity_source": "ERROR",
      "sources": [
        "src.path.varchar"
      ]
    },
    {
      "id": "message.hstore-key",
      "sqlstate": "22001",
      "primary_template": "string too long for hstore key",
      "severity_source": "ERROR",
      "sources": [
        "src.path.hstore"
      ]
    },
    {
      "id": "message.hstore-value",
      "sqlstate": "22001",
      "primary_template": "string too long for hstore value",
      "severity_source": "ERROR",
      "sources": [
        "src.path.hstore"
      ]
    },
    {
      "id": "message.varbit",
      "sqlstate": "22001",
      "primary_template": "bit string too long for type bit varying(%d)",
      "severity_source": "ERROR",
      "sources": [
        "src.path.varbit"
      ]
    }
  ],
  "usage_evidence": [
    {
      "scope": "definition",
      "status": "definition_only",
      "evidence_ids": [
        "identity"
      ]
    },
    {
      "scope": "fixed-source-path",
      "status": "source_path_confirmed",
      "evidence_ids": [
        "mechanism.character-varchar",
        "mechanism.extension-types"
      ]
    },
    {
      "scope": "history",
      "status": "unknown",
      "evidence_ids": [
        "history"
      ]
    },
    {
      "scope": "selected-varchar-18.6-and-10.21",
      "status": "observed_runtime",
      "evidence_ids": [
        "runtime.observation",
        "runtime.22001-data1-latest.latest",
        "runtime.22001-data1-pg10.pg10"
      ]
    }
  ],
  "runtime": [
    {
      "id": "runtime.22001-data1-latest.latest",
      "run_id": "22001-data1-latest",
      "target": "latest",
      "server_version": "18.6 (Homebrew)",
      "server_version_num": 180006,
      "status": "passed",
      "cases": [
        "varchar_width_overflow"
      ],
      "summary_sha256": "d4700f6daef109b19ddfddc1f70948979400702a04024dc8ba4dfbcb13cd3def",
      "raw_sha256": "722254ec20e72752649e81427aec2e21f8072d75e22960c3183883a04625c48a",
      "snippet_registry": {
        "sha256": "ee3932e6fef2bd5b1c3ff35391019940f81eb61fd72854d9c79447efceeab634"
      },
      "observed": {
        "sqlstate": "22001",
        "status_after_repair": "IDLE"
      }
    },
    {
      "id": "runtime.22001-data1-pg10.pg10",
      "run_id": "22001-data1-pg10",
      "target": "pg10",
      "server_version": "10.21 (Debian 10.21-1.pgdg90+1)",
      "server_version_num": 100021,
      "status": "passed",
      "cases": [
        "varchar_width_overflow"
      ],
      "summary_sha256": "0acd54978ccf0df63136d6d32d1259804d5ae52c1cf9b45a48b165bdc9f201e1",
      "raw_sha256": "da3eabf6714cfde3179b8d3456f74b7378ea4fc24b63905a8fef18acc93a8d31",
      "snippet_registry": {
        "sha256": "ee3932e6fef2bd5b1c3ff35391019940f81eb61fd72854d9c79447efceeab634"
      },
      "observed": {
        "sqlstate": "22001",
        "status_after_repair": "IDLE"
      }
    }
  ]
}
