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
NpgsqlRange.Parse use culture-specific parsing #3599
Execute following code while having non-dot decimal separator in current culture:
NpgsqlRange<decimal>.Parse("[1.1, null)")
The issue
I expect parse to work with invariant format for values but it is not the case.
System.TypeInitializationException : The type initializer for 'NpgsqlRanges' threw an exception.
----> System.Exception : 1.1 is not a valid value for Decimal.
----> System.FormatException : Input string was not in a correct format.
Aww, tried to use culture-specific format and got Ranges with embedded commas are not currently supported. trying to parse 1,1 value. Which is expected, but makes Parse unusable
I'd generally suggest avoiding Parse and using the constructors to construct the range you want; Npgsql generallz shouldn't be in the business of parsing string representations of arbitrary PostgreSQL types...
Activity
MaceWindu commentedon Mar 14, 2021
Aww, tried to use culture-specific format and got
Ranges with embedded commas are not currently supported.trying to parse 1,1 value. Which is expected, but makes Parse unusablehttps://github.com/npgsql/npgsql/blob/main/src/Npgsql/NpgsqlTypes/NpgsqlRange.cs#L410
roji commentedon Mar 15, 2021
I'd generally suggest avoiding Parse and using the constructors to construct the range you want; Npgsql generallz shouldn't be in the business of parsing string representations of arbitrary PostgreSQL types...
roji commentedon Mar 15, 2021
Am closing this as I don't think we should fix the Parse logic, but rather remove entirely as in #3168.
Fix multi host data source type reloading