0

I am building an asp.net core web application. I just migrated my database from MariaDB to PostgreSQL. After the succesful migration I found out that all my table and column names were renamed to lowercase. Because of this, Entity Framework Core does not find tables in my database and columns in my table.

Im wondering if there is any way to:

  • Avoid this from happening (keep the Case and not rename it to lowercase)
  • Configure Entity Framework Core to not be case sensitive

Kind regards, Brian

  • re question 1: I would expect your migration tool set to follow PostgreSQL conventions, which are pretty much saying that lowercase is to be preferred (you can circumvent it though by always using quotes but: https://stackoverflow.com/a/2878408/5630865 - but if you can somehow manage it, stick with lowercase) – von_court May 02 '21 at 20:01
  • Postgres is **not case sensitive** regarding object names unless the names are doubled quoted (this is different from the SQL Standard which specifies upper case). You can still use upper case or camel case in your queries. You just need to keep in mind that when Postgres talks back to you object names will be lower case. As mentioned you can avoid this by double quoting all names. But I suggest you do not, cause if you do you must **always** double quote; this causes all kinds of errors. – Belayer May 03 '21 at 00:19
  • @Belayer That is nitpicking, but SQL *is* case sensitive. Only everything that is not quoted will be converted to lower case. – Laurenz Albe May 03 '21 at 06:19
  • @LaurenzAlbe: That is why I said *regarding object names unless the names are doubled quoted*. I do not think it is nitpicking I think OP was mis-understanding of the conversion and thinking they would need to convert their code to lower case. Guess it is a case of same view, but seeing different things. – Belayer May 03 '21 at 16:49
  • Which tool did you use and, eventually, did you find a way to avoid this from happening? – Udi Aslan Sep 13 '22 at 12:27

0 Answers0