Repository navigation
PostgreSQL: Parse a word after an interval value that is not a PostgreSQL field as an alias - #2775
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2775 +/- ##
=======================================
Coverage 82.59% 82.59%
=======================================
Files 42 42
Lines 35575 35582 +7
Branches 35575 35582 +7
=======================================
+ Hits 29382 29389 +7
Misses 2659 2659
Partials 3534 3534 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
LucaCappelletti94
force-pushed
the
upstream/postgres-interval-qualifier
branch
2 times, most recently
from
October 30, 2026 14:30
4c51d18 to
4c65936
Compare
sabir-akhadov-localstack
approved these changes
Oct 30, 2026
…eSQL field as an alias
LucaCappelletti94
force-pushed
the
upstream/postgres-interval-qualifier
branch
from
October 30, 2026 17:41
4c65936 to
2fa1622
Compare
Contributor
Author
|
Thanks @sabir-akhadov-localstack for the review, I will merging this now. cc @alamb |
This was referenced Oct 30, 2026
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.
SELECT interval '1' weekparses as a one-week interval underPostgreSqlDialect, but PostgreSQL (VERY COUNTERINTUITIVELY) returns one second in a column namedweek. Its grammar (opt_intervalin gram.y) takes onlyYEAR,MONTH,DAY,HOUR,MINUTEandSECONDand theirTOranges as an interval qualifier, so any other word after the value is a column alias. The same holds fordecade,quarter,epochand plural spellings such asdays.The words that can start a qualifier move from
Parser::next_token_is_temporal_unitinto a newDialect::is_interval_qualifier, with the existing list as the default and PostgreSQL's six fields as its override. Other dialects parse as before.