Skip to content

[8.0] Truncate sub-microsecond ticks when formatting TimeSpan as interval - #3948

Merged
roji merged 1 commit into
hotfix/8.0.12from
roji-8-0-interval-backport
Oct 14, 2026
Merged

roji merged 1 commit into
hotfix/8.0.12from
roji-8-0-interval-backport

Conversation

@roji

@roji roji commented Oct 14, 2026

Copy link
Copy Markdown
Member

Backport of #3932.

Fixes #3926.

Truncate sub-microsecond TimeSpan ticks before formatting PostgreSQL intervals, preventing trailing decimal separators and negative zero. Includes the original SQL-literal and JSON reader/writer regression coverage; the shared NodaTime Duration formatter benefits automatically. No 8.0 compatibility adaptations were necessary.

Validation: dotnet test test/EFCore.PG.Tests/EFCore.PG.Tests.csproj --no-restore --filter FullyQualifiedName~NpgsqlTypeMappingTest — 112 passed, 6 existing skips. Restore used a temporary local feed containing the exact configured 8.0.6 packages after NuGet resolution failed; dependency versions and repository configuration are unchanged.

Fixes #3926

(cherry picked from commit e596f10)
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 4ce38fd3-6f82-47ff-b21a-589c3aeb04b9
@roji
roji merged commit 012de26 into hotfix/8.0.12 Oct 14, 2026
9 of 12 checks passed
@roji
roji deleted the roji-8-0-interval-backport branch October 14, 2026 17:33
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.

TimeSpan with sub-microsecond ticks is serialized to an invalid JSON interval string

2 participants