Repository navigation
Description
Problem
Shift/Expand move a bound that stands for PostgreSQL ±infinity as if it were an ordinary date. A column holding [2026-01-01,infinity) loads as [2026-01-01,9999-12-30] (the #117 read rule). .Shift(-1) then saves [2025-12-31,9999-12-30), a finite range. PostgreSQL's own upper(r) - 1 keeps infinity. A tsrange […,infinity) saves as 9999-12-30 23:59:59.999999. A live probe confirmed all three. docs/efcore.md says MaxValue "stands for" infinity, but under these two operations it doesn't. Found by the pre-tag analysis (#179). Silent when written back.
Decision (maintainer, 2026-10-18)
On the temporal types whose extremes stand for ±infinity, Shift and Expand leave a bound at MinValue/MaxValue where it is, as infinity ± d stays infinite in PostgreSQL. The types are DateRange, DateTimeRange, DateTimeOffsetRange, and the NodaTime temporal ranges whose store mapping uses infinity (check YearMonthRange). A move that would carry a finite bound past an extreme still throws OverflowException. Integer and float ranges are unchanged: their extremes are ordinary values.
Check the interaction with the read rule from #117: a bound that loaded from infinity must come back as the same extreme, so a round trip through Shift(d).Shift(-d) stays the identity.
Done when
- docs/ranges.md (Shift/Expand) and docs/efcore.md state the rule.
- A claim holds it.
- A live test shows that a row read from
[x,infinity), shifted and saved, still readsupper_inf/infinityfrom PostgreSQL, and fails with the rule removed.
Activity
CaffeinatedCoder commentedon Oct 18, 2026
Fixed in #238. One part of the done-when can't hold as written: a
daterangewith an exclusiveinfinity)comes back finite from a plain save, moved or not. It loads as[x,9999-12-30], and the plugin writes that as[x,9999-12-31), the behaviour #117 settled by documenting. For that form the live test (InfinityShiftRoundTripTests) holds that the moved row saves exactly as the unmoved one does. Thetsrange,tstzrange,daterange [x,infinity]and[-infinity,x]and NodaTime rows still holdinfinityafter a shift and save. A closed date range's end the day before the maximum counts asinfinity)and stays, which fixes the issue's first example in memory.test: waive the temporal ranges' IsInfinity helper