New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
implement PostgreSQL-compatible interval type #1444
implement PostgreSQL-compatible interval type #1444
Conversation
I haven't looked into the code yet, but re keeping days and durations in the same field: I believe that this should be the same for all of our times since we're UTC ignoring leap seconds, but when we start supporting timezones that have something like DST there will be a difference. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm only about half way done but I thought I'd share the small things that I've got so far.
Overall this is looking amazing!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🥇 oh boy.
You don't need to implement all my changes, but an explicit yup/nope would make it easier for me to think through what you have done/intend to do.
@quodlibetor just wanted to give you a quick thanks and let you know I'll implement all of these comments this week. Appreciate your guidance on all these points; lots of things I wasn't aware of/old habits from Go. |
@quod_libetor Thanks for your patience on this. tl;dr I cleaned up everything you requested/didn't clean up anything we agreed to leave as-is. Detailed notes:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💰💰💰💰💰💰💰💰
This PR refactors
interval
to improve PostgreSQL compatibility.Biggest changes include:
1-2 3 4:5:6:7
and1 year 2 months...
respectively).INTERVAL '1-2 3 4:5' MONTH
)interval
docs.Note: I'm missing comprehensive unit tests, but will add those once I get a greenlight that the overall structure of this code looks good.
Quick addendum:
month
,day
,duration
. However, I kept our implementation more similar to its prior iteration which only tracksmonth
andduration
, and treatsday
as part of duration. I haven't dug into ways in which this could interact withTIMESTAMP
math, but it doesn't cause any regression in our current behavior.MONTH TO MINUTE
,MONTH
is a noop). I instead let this define the most significant value to keep in the output. This seems useful but ¯_(ツ)_/¯--is very easy to yank out.