-
Notifications
You must be signed in to change notification settings - Fork 873
Description
After upgrading to Npgsql v10, my application crashes with a date-parsing exception for PostgreSQL DATE columns that contain values formatted as dd/MM/yyyy.
The same code works perfectly in Npgsql v9, so this appears to be a regression introduced in v10 (released today).
๐ Environment
Npgsql Version: 10.x (latest)
Previous Working Version: 9.x
.NET: .NET 10
Application Type: C# WinForms application using Dapper ORM
OS: Windows 11
Database: PostgreSQL 17
โ Exception
System.Data.DataException: Error parsing column 31 (expirydate=24/11/2025 - DateOnly)
๐ What Happened
Our PostgreSQL table contains a DATE field (expirydate) which stores values in dd/MM/yyyy format, for example:
24/11/2025
This maps to a normal C# property:
public DateTime? ExpiryDate { get; set; }
In Npgsql v9, this works perfectly.
In Npgsql v10, the same code throws an exception.
No breaking change related to date formats is documented.
This indicates a regression in the new v10 release.
โ Expected Behavior
Npgsql should continue supporting PostgreSQLโs valid date formats (including dd/MM/yyyy when DateStyle is configured accordingly).
Parsing rules should match v9โs behavior unless intentionally changed and documented.
๐ซ Actual Behavior
Npgsql v10 now attempts strict parsing into DateOnly.
It rejects dd/MM/yyyy even though PostgreSQL stores it.
A fatal exception is thrown during data mapping.
This did not happen in any previous version.
๐งช Minimal Repro Code
var products = connection.Query<Product>(
@"SELECT expirydate FROM products WHERE productid = 1"
).ToList();
Model
public class Product
{
public DateTime? ExpiryDate { get; set; }
}
Value in PostgreSQL
24/11/2025
Results
v10 โ exception
v9 โ works normally
๐ Notes
Npgsql v10 was released only a few hours ago โ this may be an early regression.
If strict DateOnly parsing was intentional, it is not documented.
Many production PostgreSQL systems store non-ISO date formats, so this breaks real-world applications.
๐ฃ Request
Please confirm:
Is this a bug or intended behavior?
If intended, can we get a compatibility option to keep v9 date-parsing behavior?
If a bug, please fix in the next patch release (10.0.x).
Thank you!