-
Notifications
You must be signed in to change notification settings - Fork 228
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UseCollation gives error invalid LC_COLLATE locale name #3358
Comments
@pantonis EF just passes the values you specify to CREATE COLLATION, CREATE DATABASE - it's your responsibility to make sure they're correct and make sense. Specifically in your code sample, it seems like you're trying to create a custom collation in a database, but also use that custom collation as the database collation - that's a chicken-and-egg problem (the database must first exist before you can create a collation inside of it). You may be able to first create the database with the default collation, and have a separate migration for creating the custom collation, and alter the databaes to use that; I'm no longer sure what PostgreSQL supports here exactly, and what it doesn't. |
Another note is that IIRC non-deterministic collations may not work well as the default database collation in PostgreSQL, because they affect internal PG catalog comparisons, and other aspects (this may have changed since I last checked). I'd consider simply using EF's conventions to assign your collation to all string columns; this is covered in the docs. |
So we need a migration as soon as we create the dbcontext without any tables and just with only
Then we start creating the dbContext with the tables and create a new migation? |
You can give it a try - let me know if that works. |
I m trying to create a new collation that is case insensitive. and when I run
Update-Database
it gives the following errorI have created a sample project that demonstrates this. Repo here
The text was updated successfully, but these errors were encountered: