Repository navigation
docs: the date extremes stand for the infinities, on every read path - #173
Merged
Merged
Conversation
#117 proposed reading an exclusive infinite date bound as the inclusive extreme, so [x,infinity) would keep 9999-12-31. Measured against PostgreSQL 17 it can't be done consistently: - Column, upper side: Npgsql reads infinity) and 9999-12-31) as the same DateOnly, and [x,9999-12-31) is how PostgreSQL stores the plugin's own [x,9999-12-30]. Reading it inclusive made DifferentialFuzzParityTests load every such row a day long. - Column, lower side: PostgreSQL's own algebra produces the exclusive form, (,) - (,-infinity] = (-infinity,), which excludes the minimum it subtracted. Reading it inclusive failed DifferentialFuzzParityTests for Except, Complement and operator -. - Literal: changing only the text would make one server value read as [x,9999-12-30] from its column and [x,9999-12-31] from its text. So the extreme is the infinity, as Npgsql's mapping and StoreTemporal already say, and the reading stays. Documented in architecture.md's boundary section (with a table), serialization.md (claim J36) and efcore.md#rows-written-by-other-tools, which tells other writers to use an absent or inclusive open end. DomainBoundaryDivergenceTests now holds the column and the text (Parse, a multirange literal, LocalDateRange) to the same value for eight forms; planting either proposed reading fails it. LiteralCorpusProbeTests counts the infinity-bound write-back of the date kinds as that documented boundary, so the four #117 candidates go. The column plant is kept as a seed for DifferentialFuzzParityTests. Closes #117 Found-By: OT Defect-Class: STORE Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Oct 18, 2026
…bound # Conflicts: # CHANGELOG.md # docs/architecture.md # test/CodoMetis.ValueRanges.EFCore.PostgreSQL.IntegrationTests/DomainBoundaryDivergenceTests.cs # test/oracles/candidates.json
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.
Closes #117
Stacked on #171 (base
fix/inverted-range-literal); retarget tomainonce #171 merges.Problem
A date range with an exclusive infinite bound, the form
daterange('2026-01-01', 'infinity')prints, reads as[2026-01-01,9999-12-30]through a column and through every literal entry point, while PostgreSQL's range also holds its real 9999-12-31, andupper(x)givesinfinity. The issue proposed reading the exclusive bound as the inclusive extreme ([2026-01-01,9999-12-31]), and offered documenting it as the alternative.The proposed reading can't be made consistent. Measured against PostgreSQL 17:
[x,infinity)and[x,9999-12-31)as the sameNpgsqlRange<DateOnly>(both9999-12-31, upper exclusive).[x,9999-12-31)is how PostgreSQL stores the plugin's own[x,9999-12-30]. Reading it inclusive inFromProvidermadeDifferentialFuzzParityTestsload every stored[x,9999-12-30]as[x,9999-12-31].-infinity, but PostgreSQL's own algebra produces it:(,) - (,-infinity]is(-infinity,), which excludes the minimum it subtracted. Reading it inclusive failedDifferentialFuzzParityTestsforExcept,Complementandoperator -onDateRangeandLocalDateRange.RangeFormatwould make one server value read as[x,9999-12-30]from its column and[x,9999-12-31]from its own text.So in this library the date extreme is the infinity, as Npgsql's mapping and the
StoreTemporalrule already say, and an exclusive infinity excludes it on every path. The reading stays, and this PR documents and pins it. No behaviour changes, so there's no changelog Breaking line and no migration entry; there is aDocs:line under Fixed.Change
docs/architecture.md#domain-width-and-the-boundary: a paragraph and table, "The date extremes stand for the infinities", with why the inclusive reading can't be used.docs/serialization.md#dates-and-times-are-strict-iso-8601: the literal rule (claim J36 quotes it).docs/efcore.md#rows-written-by-other-tools: other writers'[x,infinity)rows load one day short. Have them write an absent bound (daterange(x, NULL)→[x,)) or an inclusive one ('[x,infinity]'→[x,9999-12-31]).DomainBoundaryDivergenceTests(integration): for eight forms (daterange(x,'infinity'),'(-infinity,x]', both infinities in both bound styles,(,infinity),(-infinity,), inclusive infinity, the plugin's own[x,9999-12-30]), the column read equalsParseof the server's text, a multirange literal of it, and theLocalDateRangereads. A second test pins the divergence itself: the server's range contains its 9999-12-31.LiteralCorpusProbeTests: theinfinity boundfamily's write-back on the date kinds counts as this documented boundary. That includesLocalDateRange's-9998-01-02, which PostgreSQL refuses on write (loud). The four#117candidates are removed.test/oracles/seeds/column-minus-infinity-read-as-minimum.patch: the column-side reading, caught byDifferentialFuzzParityTests.Docs:line under 10.0.0 Fixed (root and core).Tests
RangeFormatreads an exclusiveinfinity/-infinitybound inclusive) fails 6DomainBoundaryDivergenceTestscases, e.g.daterange('2026-01-01', 'infinity') through its text [2026-01-01,infinity).FromProvider) fails 3 cases andDifferentialFuzzParityTests.dotnet test: every project passes, both integration suites included (Docker, postgres:17).🤖 Generated with Claude Code