I have read several posts where they relate that the case sensitive of postgres is activated automatically, when creating tables or fields with capital letters. I also read some that relate the use of quotation marks.
However, my bank does not have any capital letters or tables. They also don't have names in quotes.
I'm using Postgres 9.2 and Entity Framework, and I get this error:
Npgsql.PostgresException (0x80004005): 42P01: relation "Usuario" does not exist
My column is called 'usuario'
I did a test using a DataAnnotation [Table (name = 'user')] and in this case the search for the right one. However I cannot put annotations in all classes / attributes.
The same system, classes / attributes, work normally with a MySQL database. How can I configure Postgres?
You can set the EF naming convention using UseSnakeCaseNamingConvention. Or if you want to import table definitions from your existing tables to EF, you can
dotnet ef dbcontext scaffold "Host=my_host;Database=my_db;Username=my_user;Password=my_pw" Npgsql.EntityFrameworkCore.PostgreSQL
You might also consider upgrading your PostgreSQL version, 9.2 is not in support any more. That doesn't affect the case problem in naming.
User contributions licensed under CC BY-SA 3.0