{
  "schema": 1,
  "sqlstate": "22031",
  "condition_name": "invalid_argument_for_sql_json_datetime_function",
  "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#L216",
      "lines": "216"
    },
    {
      "id": "src.path.0",
      "kind": "upstream_source",
      "source_role": "resolved_report_context",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "src/backend/utils/adt/jsonpath_exec.c",
      "sha256": "678cb8947f0b5e6ad14524f1863987ab99641cfb5f81121fc5c5006af0319d02",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/adt/jsonpath_exec.c#L2469",
      "lines": "2469-2473"
    },
    {
      "id": "src.jsonpath.datetime",
      "kind": "upstream_source",
      "source_role": "resolved_report_context",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "src/backend/utils/adt/jsonpath_exec.c",
      "sha256": "678cb8947f0b5e6ad14524f1863987ab99641cfb5f81121fc5c5006af0319d02",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/adt/jsonpath_exec.c#L2326",
      "lines": "2326-2780"
    },
    {
      "id": "src.jsonpath.context-flags",
      "kind": "upstream_source",
      "source_role": "resolved_report_context",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "src/backend/utils/adt/jsonpath_exec.c",
      "sha256": "678cb8947f0b5e6ad14524f1863987ab99641cfb5f81121fc5c5006af0319d02",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/adt/jsonpath_exec.c#L235",
      "lines": "235-249"
    },
    {
      "id": "src.jsonpath.execute-context",
      "kind": "upstream_source",
      "source_role": "resolved_report_context",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "src/backend/utils/adt/jsonpath_exec.c",
      "sha256": "678cb8947f0b5e6ad14524f1863987ab99641cfb5f81121fc5c5006af0319d02",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/adt/jsonpath_exec.c#L654",
      "lines": "654-727"
    }
  ],
  "claims": [
    {
      "id": "identity",
      "statement": "22031 is invalid_argument_for_sql_json_datetime_function in SQLSTATE Class 22.",
      "sources": [
        "src.errcodes.18.6"
      ],
      "method": "Read fixed definition."
    },
    {
      "id": "resolved-path",
      "statement": "The fixed jsonpath datetime-method implementation first requires a string item. An explicit .datetime(template) call passes the template to parse_datetime with NULL ErrorSaveContext only when jspThrowErrors(cxt) is true; otherwise it saves the parse error and returns jperError. The no-template ISO candidate loop saves each candidate failure even on throwing execution, then the final RETURN_ERROR branch decides whether an unrecognized format throws 22031 or returns a path error. Lax controls structural auto-wrap/unwrap and structural errors; it does not generally suppress datetime parse/conversion errors. Precision, type conversion, and format guards remain 22031 paths.",
      "sources": [
        "src.path.0",
        "src.jsonpath.datetime",
        "src.jsonpath.context-flags",
        "src.jsonpath.execute-context"
      ],
      "method": "Read executeDateTimeMethod together with the jsonpath context flags and RETURN_ERROR macro.",
      "limits": "Source confirmation is not a natural runtime observation."
    },
    {
      "id": "history",
      "statement": "The locked catalogue records 22031 from 13.0 without proving exact implementation introduction.",
      "sources": [
        "src.errcodes.18.6"
      ],
      "method": "Use catalogue boundary."
    }
  ],
  "messages": [
    {
      "id": "message.0",
      "sqlstate": "22031",
      "primary_template": "%s format is not recognized: \"%s\"",
      "severity_source": "ERROR",
      "sources": [
        "src.path.0"
      ]
    },
    {
      "id": "message.string-only",
      "sqlstate": "22031",
      "primary_template": "jsonpath item method .%s() can only be applied to a string",
      "severity_source": "ERROR",
      "sources": [
        "src.jsonpath.datetime"
      ]
    },
    {
      "id": "message.format-unrecognized",
      "sqlstate": "22031",
      "primary_template": "%s format is not recognized: \"%s\"",
      "severity_source": "ERROR",
      "sources": [
        "src.jsonpath.datetime"
      ],
      "hint_template": "Use a datetime template argument to specify the input data format."
    },
    {
      "id": "message.precision-range",
      "sqlstate": "22031",
      "primary_template": "time precision of jsonpath item method .%s() is out of range for type integer",
      "severity_source": "ERROR",
      "sources": [
        "src.jsonpath.datetime"
      ]
    },
    {
      "id": "message.precision-invalid",
      "sqlstate": "22031",
      "primary_template": "time precision of jsonpath item method .%s() is invalid",
      "severity_source": "ERROR",
      "sources": [
        "src.jsonpath.datetime"
      ]
    }
  ],
  "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": []
}
