Page 1 of 1
PSql case sensitivy in EF Core
Posted: Fri 13 Jul 2018 16:25
by dgxhubbard
Does dotConnect for Postgre have any sort of processing to make a sql statement case sensitive.
Right now we are manually processing our raw sql and double quoting where needed.
Example
Code: Select all
select distinct "Buyers"."Name", "Buyers"."Description" from "MySchema"."Buyers" order by "Name";
Re: PSql case sensitivy in EF Core
Posted: Tue 17 Jul 2018 09:52
by Shalex
ADO.NET: default case in PostgreSQL Server is a lower case. You should either name objects in database in a default (lower) case or quote identifiers' names in the query manually.
EF Core: please set config.Workarounds.DisableQuoting=false; in your EF Core code. Refer to
https://devart.com/dotconnect/postgresq ... tions.html.
Re: PSql case sensitivy in EF Core
Posted: Tue 17 Jul 2018 22:57
by dgxhubbard
I am getting the right behavior from ef core statements and double quotes. I am saying we have manual queries we need to run against sqlite, sql server and postgre. In the dotConnect Postgre porvider is there a general method users can get to and give the method a query and have the table names, schema and column names double quoted for us.
This would be a great feature.
Re: PSql case sensitivy in EF Core
Posted: Wed 18 Jul 2018 05:57
by Shalex
We recommend you to use lower case for all names in your PostgreSQL database to avoid the need to quote identifiers.
Re: PSql case sensitivy in EF Core
Posted: Wed 18 Jul 2018 16:06
by dgxhubbard
The problem is we run against multiple databases and that is not an option.
That is why I asked if you had such a method it would be a great benefit to customers.
Re: PSql case sensitivy in EF Core
Posted: Mon 23 Jul 2018 09:23
by Shalex
We think that quoting queries is a task of the code that constructs these queries. For example: PgSqlCommandBuilder, EF engine.
If you initialize cmd.CommandText with some query, the provider should execute the query as it is.
Why don't you want to use the same quoted queries for both SQL Server and PostgreSQL?