-
-
Notifications
You must be signed in to change notification settings - Fork 250
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
Mapping PG interval type #629
Mapping PG interval type #629
Conversation
Can you include this kind of explanation of this type in this PR in docs? References into the Postgres docs is fine, just something that makes it easy to cross-reference without doing more legwork, ideally. I legitimately find their choice of layout confusing, so a better understanding of the intent would be nice. |
i've added some background to the storage layout and some important qualifying info to the methods/accessors |
...I feel sufficiently bothered by Postgres's decisions I almost want to say |
ok did some C investigations here
and got these results
So this is as expected according to the docs based on the way you input units.
I'm going to adjust my |
k i've made the adjustments i described before. I no longer used this
|
Thanks for investigating that! Yes, I agree, if Postgres actually produces "out of bounds" (highly relatively speaking) intervals, I agree that we shouldn't try to validate inputs (...now that I understand what Postgres is doing a bit better). |
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 will need to be updated to use the new type mapping strategy after #615 is merged, so 0.5.1 is the more practical time for this to be released.
updated for #615 |
Request now stale but approval not yet granted.
Apologies, it seems #677 was also fated to stomp on this. 😬 |
@workingjubilee I made an attempt at the PgBox change, in it's |
Going to attempt to finish review on this and actually get it merged soon. |
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 mentioned these in a Discord discussion but to formally register the remarks, for transparency's sake (and easier reference):
when the automated testing fails for transient non-code reasons (timeouts, etc) should we do anything? Not sure if the failures hold anything up. |
"worked on my machine" ^_^ my local |
@workingjubilee am I missing something? It says you still have a change requested but i don't see anything in the PR thread |
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.
Sorry, this was waiting on me to re-review the pointer manipulation for correctness and doublecheck the API. Things look okay here. I have just one final nit and this should be good to go in.
@workingjubilee, i've renamed those, thanks |
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.
Hokay! Then I think we can call this done! Thank you!
Interval
(any collision/confusion potential withpg_sys::Interval
?) is an opaque type that can convert to/fromtime::Duration
.time::Duration
has a wider range of representation than PG's. Because the native datum is a combination of i32 month/day "leaps" with a precision i64 microsecond (usually less than 1 day's worth) offset, it's non-trivial to find a true MIN/MAX value. So we're artificially constraining the bound check of Duration-into-Interval to PG's statedinterval
range of -/+ 178_000_000 years.