{
  "schema": 1,
  "sqlstate": "22007",
  "condition_name": "invalid_datetime_format",
  "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#L179",
      "lines": "179"
    },
    {
      "id": "src.calls.REL_18_6",
      "kind": "local_artifact",
      "source_role": "source_call_scan",
      "sha256": "9ee8a0e81d8f0825c5c1ae45583439859a26e602bdd4ce2f2a62aa278867ccbf"
    },
    {
      "id": "src.path.interval-format",
      "kind": "upstream_source",
      "source_role": "source_guard",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "src/backend/utils/adt/formatting.c",
      "sha256": "a22651cc223e93c1879420004027325579fc79a3ba8684408496149164a2220c",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/adt/formatting.c#L548-L559",
      "lines": "548-559"
    },
    {
      "id": "src.path.date-input",
      "kind": "upstream_source",
      "source_role": "source_parser",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "src/backend/utils/adt/date.c",
      "sha256": "4834c868f3461822eb0de972fe35b04f9fb9ba75cf2fa9794a67259536f35773",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/adt/date.c#L110-L178",
      "lines": "110-178"
    },
    {
      "id": "src.path.datetime-error",
      "kind": "upstream_source",
      "source_role": "source_error_mapping",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "src/backend/utils/adt/datetime.c",
      "sha256": "709e05b536f611f7eeaaabb716501d59d4d1e87c53757e15240fe1fc4845459c",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/adt/datetime.c#L4195-L4266",
      "lines": "4195-4266"
    },
    {
      "id": "doc.datetime-input.18.6",
      "kind": "upstream_source",
      "source_role": "official_documentation",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "doc/src/sgml/datatype.sgml",
      "sha256": "86328daa77e20d81d222376ec0306d9841a17104e436c08d138eb763aefb3700",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/datatype.sgml#L1878-L1896",
      "docs_url": "https://www.postgresql.org/docs/18/datatype-datetime.html#DATATYPE-DATETIME-INPUT",
      "lines": "1878-1896"
    },
    {
      "id": "snippet-registry.22007",
      "kind": "local_artifact",
      "source_role": "runtime_input",
      "sha256": "cea6f9f6a07e3371f1ebc79d2842da2c66c06750f3b39f91b7fdd57fb2b7d0a9"
    }
  ],
  "claims": [
    {
      "id": "identity",
      "statement": "22007 is invalid_datetime_format in SQLSTATE Class 22.",
      "sources": [
        "src.errcodes.18.6"
      ],
      "method": "Read fixed definition."
    },
    {
      "id": "mechanism.interval-format",
      "statement": "The interval/time formatting guard rejects calendar-specific format tokens for interval values and supplies a fixed hint explaining the calendar boundary.",
      "sources": [
        "src.path.interval-format"
      ],
      "method": "Read the INVALID_FOR_INTERVAL macro and both message fields.",
      "limits": "The selected runtime covers interval formatting only."
    },
    {
      "id": "mechanism.datetime-input",
      "statement": "Fixed date input dispatches text through ParseDateTime and DecodeDateTime. DateTimeParseError maps the DTERR_BAD_FORMAT/default branch to 22007 with the common primary invalid input syntax for type template; field overflow and month/day overflow use 22008, with the latter adding a DateStyle hint. The PostgreSQL 18 documentation describes DateStyle as selecting the interpretation order for ambiguous numeric date input, and the parser can fill ErrorSaveContext instead of throwing for soft-validation callers.",
      "sources": [
        "src.path.date-input",
        "src.path.datetime-error",
        "doc.datetime-input.18.6"
      ],
      "method": "Read the fixed date input/parser and error mapping, then the same-version documentation.",
      "limits": "This confirms source and documentation scope only; the selected runtime covers interval formatting, not DateStyle parsing."
    },
    {
      "id": "history",
      "statement": "The locked catalogue records 22007 from 7.4 without proving an exact implementation introduction date.",
      "sources": [
        "src.errcodes.18.6"
      ],
      "method": "Use catalogue boundary."
    },
    {
      "id": "runtime.observation",
      "statement": "The invalid_interval_format case passed on isolated PostgreSQL 18.6 and 10.21: the interval mask ID raised 22007 with the fixed hint, left the autocommit session IDLE, and DD returned 01.",
      "sources": [
        "manifest.22007",
        "snippet-registry.22007"
      ],
      "method": "Execute the shared registry and inspect selected summaries.",
      "limits": "The observation does not generalize to DateStyle parsing or every date/time formatter.",
      "runtime": [
        "runtime.22007-data1-latest.latest",
        "runtime.22007-data1-pg10.pg10"
      ]
    }
  ],
  "messages": [
    {
      "id": "message.interval",
      "sqlstate": "22007",
      "primary_template": "invalid format specification for an interval value",
      "severity_source": "ERROR",
      "sources": [
        "src.path.interval-format"
      ],
      "hint_template": "Intervals are not tied to specific calendar dates."
    },
    {
      "id": "message.datetime-input",
      "sqlstate": "22007",
      "primary_template": "invalid input syntax for type %s: \"%s\"",
      "severity_source": "ERROR",
      "sources": [
        "src.path.datetime-error"
      ]
    }
  ],
  "usage_evidence": [
    {
      "scope": "definition",
      "status": "definition_only",
      "evidence_ids": [
        "identity"
      ]
    },
    {
      "scope": "fixed-source-path",
      "status": "source_path_confirmed",
      "evidence_ids": [
        "mechanism.interval-format",
        "mechanism.datetime-input"
      ]
    },
    {
      "scope": "history",
      "status": "unknown",
      "evidence_ids": [
        "history"
      ]
    },
    {
      "scope": "selected-interval-18.6-and-10.21",
      "status": "observed_runtime",
      "evidence_ids": [
        "runtime.observation",
        "runtime.22007-data1-latest.latest",
        "runtime.22007-data1-pg10.pg10"
      ]
    }
  ],
  "runtime": [
    {
      "id": "runtime.22007-data1-latest.latest",
      "run_id": "22007-data1-latest",
      "target": "latest",
      "server_version": "18.6 (Homebrew)",
      "server_version_num": 180006,
      "status": "passed",
      "cases": [
        "invalid_interval_format"
      ],
      "summary_sha256": "5429879e671be538f513654b5c0821f227aac67f67e0b1fbb2d6c7821c0af675",
      "raw_sha256": "e1ab1c24625152560f9dc7baf091dbec22324d34bba0deea9c8048565500906a",
      "snippet_registry": {
        "sha256": "cea6f9f6a07e3371f1ebc79d2842da2c66c06750f3b39f91b7fdd57fb2b7d0a9"
      },
      "observed": {
        "sqlstate": "22007",
        "status_after_repair": "IDLE"
      }
    },
    {
      "id": "runtime.22007-data1-pg10.pg10",
      "run_id": "22007-data1-pg10",
      "target": "pg10",
      "server_version": "10.21 (Debian 10.21-1.pgdg90+1)",
      "server_version_num": 100021,
      "status": "passed",
      "cases": [
        "invalid_interval_format"
      ],
      "summary_sha256": "dbc6026274c92764eb19acdc4668d1aa3bb2529a01a7ca3dbcb879cb46646f9c",
      "raw_sha256": "e9f8cef16bd8674c68fb7c518fa325adbf726e8797dc8b43da20508a0ecc41dd",
      "snippet_registry": {
        "sha256": "cea6f9f6a07e3371f1ebc79d2842da2c66c06750f3b39f91b7fdd57fb2b7d0a9"
      },
      "observed": {
        "sqlstate": "22007",
        "status_after_repair": "IDLE"
      }
    }
  ]
}
