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
Reading a large interval as TimeSpan returns a wrong value instead of throwing #6726
The interval is larger than TimeSpan.MaxValue, but reading it as TimeSpan doesn't throw. The tick computation overflows and the read returns a wrapped value with the wrong sign, -8850398.05:36:10.9551616. interval '-300000000 hours' comes back positive, and interval '20000000 days' wraps the same way. PostgreSQL itself returns 300000000:00:00.
Reading an interval that has months as TimeSpan already throws InvalidCastException. An interval outside the range of TimeSpan should throw too, instead of returning a wrong value.
Further technical details
Npgsql version: main at b35800b
PostgreSQL version: 17.11
Operating system: Linux x86_64
Other details about my project setup: .NET SDK 10.0.403
Activity
vonzshik commentedon Nov 17, 2026
@Mr444-dev could you post anything here so I can assign this issue to you?