Fix PgVector ReloadTypesAsync compatibility with newer Npgsql#13706
Fix PgVector ReloadTypesAsync compatibility with newer Npgsql#13706WyRainBow wants to merge 2 commits intomicrosoft:mainfrom
Conversation
|
@microsoft-github-policy-service agree |
|
Thanks. This seems to be because of npgsql/npgsql#5919, where Npgsql 9.0 made a binary breaking change by adding the cancellation token parameter; the user is presumably trying to use the MEVD provider with Npgsql 9/10, but it was compiled against Npgsql 8.0.
The even better way to handle this is to have the provider use the newest Npgsql (10.0) when targeting modern .NET, and only use old 8.0 when targeting netstandard2.0/netfx - I've done that in #13724. |
We are currently using Npgsql 8.0 because that's the last version that's still compatible with .NET Standard 2.0/netfx; but it seems wrong to force an older version of Npgsql on modern .NET users just because netfx users require it So for the versions of the PgVector MEVD provider targeting net8.0/net10.0, use the latest Npgsql 10.0; netstandard2.0/net462 still use Npgsql 8.0. It's not ideal to use different versions of Npgsql across different TFM targets of the same library, but it seems like the lesser of the possible evils here. This incidentally also takes care of the ReloadTypesAsync problem in #13706. --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Summary
ReloadTypesAsync(CancellationToken)instead of the no-arg overloadPostgresCollectionPostgresUtilsValidation
dotnet test dotnet/test/VectorData/PgVector.UnitTests/PgVector.UnitTests.csproj