Repository navigation
docs: calendar factory rows in What runs where — PostgreSQL's first date, the extremes with the conversions off, Quarter's error text #450
Description
Found by a review of #191 (main PR #447 @ 879c82a, release/10.x PR #449 @ 684216b), checked on PostgreSQL 16.15 and 18.1. Docs only: the translation itself agrees with memory everywhere it was swept.
Problem
Three sentences about the calendar factories are imprecise.
-
PostgreSQL's first date.
docs/efcore.md#what-runs-where(theLocalDateRange/YearMonthRangerow), the EF Core README, the four calendar entries intest/oracles/translation-support.jsonandNodaCalendarFactoryClientSideTests' summary say "the years before 4713 BC have no PostgreSQL date". PostgreSQL's first date is 4714-11-24 BC:select '4714-11-24 BC'::date; -- 4714-11-24 BC select '4714-11-23 BC'::date; -- ERROR: date out of rangeThe wording also leads with
-infinity, which suggests the cell would be fine withNpgsql.DisableDateTimeInfinityConversionsset. It isn't: the month and the year that hold PostgreSQL's first day can't be built either.select date_trunc('month', '4714-11-24 BC'::date::timestamp); -- ERROR: timestamp out of range select date_trunc('year', '4714-12-31 BC'::date::timestamp); -- ERROR: timestamp out of rangeThe decision to keep the NodaTime forms in memory stands. Only its stated reason is off.
-
The extremes.
docs/efcore.mdsays "The first and last periods end at-infinityandinfinity, as Npgsql writesDateOnly.MinValueandMaxValue". That holds only with Npgsql's infinity conversions on. With them off they are the days themselves, as the translator andCalendarFactoryExtremesTestsalready know. Also, the first period starts at-infinity; it doesn't end there. -
The error text. "PostgreSQL raises an error that names the argument".
Quarter(y, 5)andQuarter(y, 0)raisemake_date's own error, which names the month the quarter became:select make_date(9999, 5*3-2, 1); -- ERROR: date field value out of range: 9999-13-01 select make_date(2026, 0*3-2, 1); -- ERROR: date field value out of range: 2026--2-01
Change
- (1) Say "dates before 4714-11-24 BC, so the month and the year that hold PostgreSQL's first day have no start", and that this holds with the infinity conversions on or off. The same in all five places.
- (2) "The first period starts at
-infinityand the last ends atinfinity, as Npgsql writesDateOnly.MinValueandMaxValue(the days themselves withNpgsql.DisableDateTimeInfinityConversions)." Then update E76's quote. - (3) Say the error names the argument or, for a quarter, the month it stands for. Or guard the quarter like the year, so its message names the quarter.
Test
Docs only. OracleCatalogueTests holds E76's quote to the reworded sentence.
Activity
CaffeinatedCoder commentedon Oct 25, 2026
Fixed in #455 (
main) and #458 (release/10.x). Re-measured on PostgreSQL 16.15. One addition to the issue's point 3:make_date's error shows the date for a month and for the year 0 as well as for a quarter (make_date(0, 6, 1)→0-06-01). Only the year and week guards name the argument, and the doc now says exactly that. Close by hand once both merge.Merge pull request #458 from CaffeinatedCoder/docs/450-calendar-facto…
CaffeinatedCoder commentedon Oct 25, 2026
Merged on both lines; #458 was the
release/10.xPR. Closed by hand, sinceClosesacts only onmain.Merge pull request #455 from CaffeinatedCoder/docs/450-calendar-facto…