Repository navigation
fix(query): name the fix when a TIMESTAMPTZ literal meets a TIMESTAMPTZ_NS column - #365
Merged
Merged
Conversation
…TZ_NS column Panel SQL that compares a time column with a TIMESTAMPTZ literal is rejected by the engine, which does not cast between TIMESTAMPTZ_NS and microsecond TIMESTAMPTZ implicitly, and its message calls the column "timestamp". Agents naturally write that literal and lose a turn. When panel SQL fails with that binder error, the problem now carries a hint: compare time columns with TIMESTAMP 'YYYY-MM-DD HH:MM:SS' (UTC), or cast the literal with ::TIMESTAMPTZ_NS. The panel sql field, the dashboard spec guide and get_telemetry_schema state the same rule. Comparison semantics are unchanged. Fixes #364 Claude-Session: https://claude.ai/code/session_018HfyEXHyGD1utmKF4CQtyQ
The pinned engine reports a BETWEEN over a TIMESTAMPTZ_NS column and TIMESTAMPTZ literals as "Cannot mix values of type ... in BETWEEN clause", which the comparison pattern missed. Recognize it for the same type pair in either order, with the same hint. Claude-Session: https://claude.ai/code/session_018HfyEXHyGD1utmKF4CQtyQ
vishr
force-pushed
the
fix/sql-timestamptz-literal
branch
from
October 20, 2026 19:37
464610b to
43e8e52
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Panel SQL that compares a time column with a
TIMESTAMPTZliteral is rejected: the engine does not cast betweenTIMESTAMPTZ_NSand microsecondTIMESTAMPTZimplicitly, and its message calls the columntimestamp. Agents naturally write that literal; one building a before/after comparison during an incident hit this and lost a turn (#364).Change
TIMESTAMP 'YYYY-MM-DD HH:MM:SS'(UTC), or cast the literal with::TIMESTAMPTZ_NS. The hint survives repeated presentation at each publication boundary.sqlfield, the dashboard spec guide andget_telemetry_schemastate the same rule; generated MCP tool docs are regenerated.Verification
TestSQLTimestampComparisonsReturnRepairHintOrExactResultsagainst the real engine: the rejected literal in both operand orders gets the hint;TIMESTAMP '…'and explicit casts, including an offset literal, return exact counts at nanosecond boundaries.just check,just docs-generate-checkFixes #364
https://claude.ai/code/session_018HfyEXHyGD1utmKF4CQtyQ