Match the Postgres repr in Time and TimeWithTimeZone #677
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.
By using a Rust-side repr that more closely reflects the internal implementation of Postgres, we head off various issues we potentially could encounter with not being able to reflect the full range that Postgres can in its implementation of these types, versus the edges that
time
types runs up against (e.g. not having the concept of a temporal "infinity" or "-infinity"). These last two types do not have quite the same problems per se, but we previously were discarding information to achieve a goal in serialization, when that can be done by simply altering the way the type is serialized.This completes #618 for all of the Postgres temporal types, reducing the likelihood of a forced breakage in the future if the
time
crate alters its implementation. We also avoid the overhead of calling potentially costly conversion functions that was noted in #504 until such points as serialization.