{
  "schema": 1,
  "sqlstate": "22004",
  "condition_name": "null_value_not_allowed",
  "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#L195",
      "lines": "195"
    },
    {
      "id": "src.calls.REL_18_6",
      "kind": "local_artifact",
      "source_role": "source_call_scan",
      "sha256": "9ee8a0e81d8f0825c5c1ae45583439859a26e602bdd4ce2f2a62aa278867ccbf"
    },
    {
      "id": "src.path.xmltable",
      "kind": "upstream_source",
      "source_role": "source_guard",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "src/backend/executor/nodeTableFuncscan.c",
      "sha256": "0a9faaa9e45bb460dd98e4688f088711d459333eb8bd94255779f2c0218df82b",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/executor/nodeTableFuncscan.c#L346-L371",
      "lines": "346-371"
    },
    {
      "id": "src.path.xmltable-filters",
      "kind": "upstream_source",
      "source_role": "source_guard",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "src/backend/executor/nodeTableFuncscan.c",
      "sha256": "0a9faaa9e45bb460dd98e4688f088711d459333eb8bd94255779f2c0218df82b",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/executor/nodeTableFuncscan.c#L380-L419",
      "lines": "380-419"
    },
    {
      "id": "src.path.xmltable-output",
      "kind": "upstream_source",
      "source_role": "source_guard",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "src/backend/executor/nodeTableFuncscan.c",
      "sha256": "0a9faaa9e45bb460dd98e4688f088711d459333eb8bd94255779f2c0218df82b",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/executor/nodeTableFuncscan.c#L494-L508",
      "lines": "494-508"
    },
    {
      "id": "snippet-registry.22004",
      "kind": "local_artifact",
      "source_role": "runtime_input",
      "sha256": "a71cda2337e992c422232fa9f7fabc158411970e959daba3c571f521e65ece0c"
    }
  ],
  "claims": [
    {
      "id": "identity",
      "statement": "22004 is null_value_not_allowed in SQLSTATE Class 22.",
      "sources": [
        "src.errcodes.18.6"
      ],
      "method": "Read fixed definition."
    },
    {
      "id": "mechanism.xmltable-namespace",
      "statement": "The XMLTABLE table-function executor rejects a NULL namespace URI and reports 22004 before producing rows.",
      "sources": [
        "src.path.xmltable"
      ],
      "method": "Read the complete namespace evaluation and NULL guard.",
      "limits": "Other functions may use 22004 for different NULL contracts."
    },
    {
      "id": "mechanism.xmltable-null-guards",
      "statement": "The table-function executor module has separate 22004 guards for null row-filter expressions, null column-filter expressions, and output columns marked NOT NULL whose value remains NULL after any DEFAULT expression is applied, each with a distinct primary message.",
      "sources": [
        "src.path.xmltable-filters",
        "src.path.xmltable-output"
      ],
      "method": "Read the complete tfuncInitialize guard sequence.",
      "limits": "The selected runtime covers only the namespace URI guard."
    },
    {
      "id": "history",
      "statement": "The locked catalogue records 22004 from 7.4 without proving an exact implementation introduction date.",
      "sources": [
        "src.errcodes.18.6"
      ],
      "method": "Use catalogue boundary."
    },
    {
      "id": "runtime.observation",
      "statement": "The xmltable_null_namespace case passed on isolated PostgreSQL 18.6 and 10.21: a NULL URI raised 22004 and the valid URI repair returned one row with the session IDLE.",
      "sources": [
        "manifest.22004",
        "snippet-registry.22004"
      ],
      "method": "Execute the shared registry and inspect selected summaries.",
      "limits": "The observation covers XMLTABLE namespace evaluation only.",
      "runtime": [
        "runtime.22004-data1-latest.latest",
        "runtime.22004-data1-pg10.pg10"
      ]
    }
  ],
  "messages": [
    {
      "id": "message.xmltable",
      "sqlstate": "22004",
      "primary_template": "namespace URI must not be null",
      "severity_source": "ERROR",
      "sources": [
        "src.path.xmltable"
      ]
    },
    {
      "id": "message.xmltable-row-filter",
      "sqlstate": "22004",
      "primary_template": "row filter expression must not be null",
      "severity_source": "ERROR",
      "sources": [
        "src.path.xmltable-filters"
      ]
    },
    {
      "id": "message.xmltable-column-filter",
      "sqlstate": "22004",
      "primary_template": "column filter expression must not be null",
      "severity_source": "ERROR",
      "detail_template": "Filter for column \"%s\" is null.",
      "sources": [
        "src.path.xmltable-filters"
      ]
    },
    {
      "id": "message.xmltable-column-output",
      "sqlstate": "22004",
      "primary_template": "null is not allowed in column \"%s\"",
      "severity_source": "ERROR",
      "guard_context": "XMLTABLE output column is marked NOT NULL and remains NULL after the output value and any DEFAULT expression have been evaluated",
      "sources": [
        "src.path.xmltable-output"
      ]
    }
  ],
  "usage_evidence": [
    {
      "scope": "definition",
      "status": "definition_only",
      "evidence_ids": [
        "identity"
      ]
    },
    {
      "scope": "fixed-source-path",
      "status": "source_path_confirmed",
      "evidence_ids": [
        "mechanism.xmltable-namespace",
        "mechanism.xmltable-null-guards"
      ]
    },
    {
      "scope": "history",
      "status": "unknown",
      "evidence_ids": [
        "history"
      ]
    },
    {
      "scope": "selected-xmltable-18.6-and-10.21",
      "status": "observed_runtime",
      "evidence_ids": [
        "runtime.observation",
        "runtime.22004-data1-latest.latest",
        "runtime.22004-data1-pg10.pg10"
      ]
    }
  ],
  "runtime": [
    {
      "id": "runtime.22004-data1-latest.latest",
      "run_id": "22004-data1-latest",
      "target": "latest",
      "server_version": "18.6 (Homebrew)",
      "server_version_num": 180006,
      "status": "passed",
      "cases": [
        "xmltable_null_namespace"
      ],
      "summary_sha256": "6d2a04c9fec0b2253747c2961000f74500aa992f83b58123a15bc0eaa3a02575",
      "raw_sha256": "245e7dc22a58a7411347c9d7ef3732ee19b16b83bd6935946330e15f883bf863",
      "snippet_registry": {
        "sha256": "a71cda2337e992c422232fa9f7fabc158411970e959daba3c571f521e65ece0c"
      },
      "observed": {
        "sqlstate": "22004",
        "status_after_repair": "IDLE"
      }
    },
    {
      "id": "runtime.22004-data1-pg10.pg10",
      "run_id": "22004-data1-pg10",
      "target": "pg10",
      "server_version": "10.21 (Debian 10.21-1.pgdg90+1)",
      "server_version_num": 100021,
      "status": "passed",
      "cases": [
        "xmltable_null_namespace"
      ],
      "summary_sha256": "ec256223667ce3481fe0284a6455601713b9a863e4320a55e02e0728a5b6373c",
      "raw_sha256": "05609b74ec6458e635c31330ee36d4ce3a5e8695b078bb1dfd29caf290eac3da",
      "snippet_registry": {
        "sha256": "a71cda2337e992c422232fa9f7fabc158411970e959daba3c571f521e65ece0c"
      },
      "observed": {
        "sqlstate": "22004",
        "status_after_repair": "IDLE"
      }
    }
  ]
}
