Skip to content

Read a word PostgreSQL has no interval qualifier for as an alias - #205

Merged
LucaCappelletti94 merged 1 commit into
mainfrom
upstream/interval-week-alias
Oct 30, 2026
Merged

LucaCappelletti94 merged 1 commit into
mainfrom
upstream/interval-week-alias

Conversation

@LucaCappelletti94

Copy link
Copy Markdown
Collaborator

apache/datafusion-sqlparser-rs#2775 made sqlparser parse interval '1' week the way PostgreSQL does: the interval has no unit and week is a column alias. pg2sqlite then reads the bare '1' as one second, which is what PostgreSQL 18 answers, so timestamp '2026-01-31' + interval '1' week gives 2026-01-31 00:00:01. The test that expected pg2sqlite to refuse that spelling now fails on main.

This replaces it with tests for what PostgreSQL answers for week, days and decade, and checks that a range PostgreSQL's grammar lacks, YEAR TO DAY, is still refused. No source change is needed.

CI needs connetto-rs/sql-traits#197 first, because sqlparser's new GrantObjects routine variants currently break sql-traits main.

@LucaCappelletti94 LucaCappelletti94 added the bug Something isn't working label Oct 30, 2026
@codecov

codecov Bot commented Oct 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@LucaCappelletti94
LucaCappelletti94 merged commit 6643d6c into main Oct 30, 2026
19 checks passed
@LucaCappelletti94
LucaCappelletti94 deleted the upstream/interval-week-alias branch November 1, 2026 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant