npgsql / doc

Documentation site for npgsql
http://npgsql.org/
26 stars 74 forks source link

Undocumented breaking change of stringValue.Contains(value) in v8 #343

Closed profet23 closed 4 months ago

profet23 commented 4 months ago

Prior to v8, our efcore queries that utilized stringValue.Contains(value) mapped to: strpos(stringValue, value) > 0.

This is documented here: https://www.npgsql.org/efcore/mapping/translations.html.

After upgrading to v8, these same efcore queries now map to stringValue LIKE '%value%'.

This doesn't break the queries per say, but it did break our index usages. We had several indexes that used the strpos to mirror the npgsql efcore query mapping, and those all needed to be updated.

This can cause havoc on a production database.

Could we get the documentation updated here? https://www.npgsql.org/efcore/mapping/translations.html

And list it as a breaking change?

roji commented 4 months ago

We had several indexes that used the strpos to mirror the npgsql efcore query mapping, and those all needed to be updated.

Just to confirm, here you're referring to PostgreSQL expression indexes, right?

Could we get the documentation updated here?

Thanks, I did this in 644ca58eeb4acb5e43af73bd440cc9853f9735a8.

And list it as a breaking change?

I don't think this constitutes a breaking change. Yes, if you have an expression index, a SQL translation change would cause it to no longer get used, but there's very little that doesn't constitute a breaking change at that point...