Skip to content

Document EFCore.PG 11.0 date/time arithmetic and interval fixes - #477

Open
jeremy-morren wants to merge 1 commit into
npgsql:mainfrom
jeremy-morren:efcore-interval-arithmetic-fixes
Open

jeremy-morren wants to merge 1 commit into
npgsql:mainfrom
jeremy-morren:efcore-interval-arithmetic-fixes

Conversation

@jeremy-morren

Copy link
Copy Markdown

Documents the EFCore.PG 11.0 fixes to date/time arithmetic with intervals, in the translation tables, the NodaTime page and the 11.0 release notes: arithmetic on timestamptz computed in UTC, truncated TimeSpan/Duration components, and negative TimeSpan/Duration values with days.

Also documents the Npgsql.ParseOldEFCoreJsonTimeSpans AppContext switch (in the release notes and the date and time page), and that existing JSON data with negative values with days must be migrated manually, with SQL to do so, and isn't read correctly by previous versions.

Companion to npgsql/efcore.pg#4116.

Copilot AI balanced review requested due to automatic review settings October 29, 2026 23:45

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The migration regex can corrupt unrelated text in serialized JSON by mistaking escaped quotes for value boundaries, so collection migrations need JSON-aware traversal instead of document-wide replacement.

1 open issue
What changed in this PR

Documents EFCore.PG 11.0 date/time and interval fixes, including compatibility considerations for existing JSON data.

Changes:

  • Updates .NET and NodaTime translation tables for UTC arithmetic and interval component handling.
  • Explains negative interval serialization, the compatibility switch, and upgrade limitations.
  • Adds SQL migration examples for existing JSON values.
File Description
conceptual/​Npgsql/​types/​datetime.md Explains negative intervals in JSON and the compatibility switch.
conceptual/​EFCore.PG/​release-notes/​11.0.md Documents behavior changes, JSON migration, and deployment warnings.
conceptual/​EFCore.PG/​mapping/​translations.md Updates date/time arithmetic and TimeSpan translations.
conceptual/​EFCore.PG/​mapping/​nodatime.md Updates Duration translations and explains UTC arithmetic.

Review effort: Balanced

Comment thread conceptual/EFCore.PG/release-notes/11.0.md Outdated
@jeremy-morren
jeremy-morren force-pushed the efcore-interval-arithmetic-fixes branch from 99e848c to 4b7f55f Compare October 30, 2026 00:05
Copilot AI balanced review requested due to automatic review settings October 30, 2026 00:05

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues remain for the date/time and interval documentation updates.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

@jeremy-morren
jeremy-morren force-pushed the efcore-interval-arithmetic-fixes branch from 4b7f55f to d9846db Compare October 30, 2026 00:28
Copilot AI balanced review requested due to automatic review settings October 30, 2026 00:28

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are recorded for the EFCore.PG 11.0 date/time and migration documentation updates.

No open issues 🎉

Review effort: Balanced

Documents the EFCore.PG 11.0 fixes to date/time arithmetic with intervals, in the translation
tables, the NodaTime page and the 11.0 release notes: arithmetic on timestamptz computed in UTC,
truncated TimeSpan/Duration components, and negative TimeSpan/Duration values with days.

Also documents the Npgsql.ParseOldEFCoreJsonTimeSpans AppContext switch (in the release notes and
the date and time page), and that existing JSON data with negative values with days must be
migrated manually, with SQL to do so, and isn't read correctly by previous versions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jeremy-morren
jeremy-morren force-pushed the efcore-interval-arithmetic-fixes branch from d9846db to 47f4529 Compare October 30, 2026 01:11
Copilot AI balanced review requested due to automatic review settings October 30, 2026 01:11

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are identified for the date/time and interval documentation updates.

No open issues 🎉

Review effort: Balanced

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants