Repository navigation
PostgreSQL: Keep the precision of typed interval literals - #2782
Open
LucaCappelletti94 wants to merge 4 commits into
Open
LucaCappelletti94 wants to merge 4 commits into
LucaCappelletti94 wants to merge 4 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2782 +/- ##
=======================================
Coverage 83.09% 83.09%
=======================================
Files 42 42
Lines 36261 36265 +4
Branches 36261 36265 +4
=======================================
+ Hits 30130 30134 +4
Misses 2636 2636
Partials 3495 3495 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
LucaCappelletti94
force-pushed
the
pg-interval-typed-literal-precision
branch
from
November 2, 2026 14:17
7278ff6 to
f24a6a4
Compare
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(2) '1 day 01:23:45.6789'rendered asSELECT INTERVAL '1 day 01:23:45.6789', and PostgreSQL rounds the value differently without the precision. This fixes the PostgreSQL case of #2763. The genericINTERVAL (100) MINUTEcase in the same issue already round-trips on main.When the typed literal path sees
INTERVALwith fields or a precision, it now builds a typed string with thatDataType::Interval, rendered asINTERVAL(2) '...'.https://www.postgresql.org/docs/current/datatype-datetime.html