Hello Support,
We get an error when will filter data on the admin section of our application it throws an error as below:
Severity = ERROR InvariantSeverity = ERROR SqlState = 0A000 MessageText = nondeterministic collations are not supported for substring searches File = varlena.c Line = 1209 Routine = text_position_setup
We are using postgres db and we don't get this error in our application because we set the collation used in filtering. We changed our db collation to Provider (icu), Locale(en-u-ks-primary). This ensures our db is case insensitive.
This is one of the points we get this error IdentityUserAppService.GetListAsyncfound in Volo.Abp.Identity namespace
We get same error in other location but once we fix this we can handle others. In this method the error comes up calling UserRepository.GetCountAsync method
In our own code to prevent this error we do something like the code below for filtering:
queryable = queryable.Where(u => EF.Functions.Collate(u.Name, "default").ToLower().Contains(filter)
|| EF.Functions.Collate(u.Surname, "default").ToLower().Contains(filter));
2 Answer(s)
-
0
This is Database Provider-specific and there is not much we can do about it.
However, you can override the
IIdentityUserRepository
repository which is resolved as UserRepository in the IdentityUserAppService. Then, override the GetCountAsync methods and you can write your own filtering.Please check overriding existing repository docs for details and sample.
-
0
Ok thanks