You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Document that a stored timerange bound of 24:00:00 fails to load #108
area/rangesRange unions, variants and the shape enginesdocumentationImprovements or additions to documentationpackage/efcoreAffects CodoMetis.ValueRanges.EFCore.PostgreSQLseverity/lowCosmetic, message or documentation-level difference
docs/efcore.md#timerange-and-the-custom-timerange-type says that TimeOnly has no 24:00:00 and tells the writer what to use instead. It doesn't say what happens to a row that already holds one — written by SQL, a migration script, or another application — and that case fails loudly on read, with an exception that doesn't name the column or the value.
Measured on main (7f4dc47) against PostgreSQL 17.11, with CREATE TYPE timerange AS RANGE (subtype = time) and a row inserted as '[22:00,24:00)'::timerange:
db.Rows.Single(x => x.Id == 1) // ArgumentOutOfRangeException: Ticks must be between 0 and and TimeOnly.MaxValue.Ticks. (Parameter 'ticks')
db.Rows.Where(...).Select(x => x.Hours.UpperBound()) // the same exception
The exception comes from Npgsql's time → TimeOnly read, so the library can't change it. It can say so: a sentence under "Good to know" that a stored 24:00:00 bound throws ArgumentOutOfRangeException when the row loads (or when UpperBound() is projected), and that the options are to store (22:00,) or [22:00,23:59:59.999999] instead, or to fix the data with UPDATE … SET hours = timerange(lower(hours), NULL).
Not a wrong answer and not a library defect — a documentation gap found in the 10.0.0 bug hunt.
area/rangesRange unions, variants and the shape enginesdocumentationImprovements or additions to documentationpackage/efcoreAffects CodoMetis.ValueRanges.EFCore.PostgreSQLseverity/lowCosmetic, message or documentation-level difference
Activity