i would like to know if it is possible to use case sensitive table names in an SQL query without using escaped quotes like in this query string "SELECT * FROM \"TableName\"" for example. Is there way to force the driver or query statement to recognize TabelName in mixed case without quoting? It's no big deal using quotes but it's simply annoying especially if you can't change the table names in the database itself any more.
I'm using a PostgreSQL JDBC driver 8.2 and i already found a lot of information on case sensitivity but there was no clear conclusion concerning case sensitivity in TABLE NAMES.
Ok, i see this problem is partly depending on the underlying database. And i've already searched the postgresql documentation for hints on how to avoid the quotes for identifier names. I just found the following statement: "SQL is case insensitive about key words and identifiers, except when identifiers are double-quoted to preserve the case..."
There are many options and parameters to set directly on the database server for incoming client connections. For example the default encoding. But i didn't find any possibility to tell the database server to use case sensitive identifier names by default.
So obviously identifier names are case insensitive by default which means at least for the JDBC driver i am using that a table named TableName will become tablename when not enclosed in backslashes and double-quotes.
And what i really wanted to know is if there is kind of a mechanism in the JDBC API or drivers to "automatically" quote identifiers in query statements and make it case sensitive this way without inserting all those annoying backslashes and double-quotes. If not then i surely will have to get used to it.