Generated invalid SQL identifiers for postgresql when specifying @Table(name=...)
TL;DR: We should not always quote table/schema name, it hardly will be the right thing to do.
I have created github repository in order to demonstrate the problem we have encountered using spring-data-jdbc with Postgresql. This application will fail with
relation "SAMPLE_ENTITY" does not exist
The problem is that spring-data-jdbc use force quoting here, which is not always the right thing to do, you can read more in this Postgresql documentation section.
To summarize, as described in this documentation section, "SAMPLE_ENTITY" and SAMPLE_ENTITY is not the same identifier name.
My suggestion is to add couple of attributes into @Table annotations, like tableNameQuoted, schemaNameQuoted in order to allow user to specify quoting policy explicitly.
Your names used in creating your tables and the mapping need to be the same. For databases like Postgresql that don't adhere to the SQL standard this means you have to use lower case names or use quoting in the create statement.
I understand, but under our dev team disposal are only java classes. The database administration (including schema creation) is almost entirely shifted to DBA team. Maybe I am the only one who have faced this issue, but still, I think it will be just the good improvement to consider.
Related: #773, #768