Skip to content

Quoting all database identifiers breaks queries to tables in custom schema [DATAJDBC-491] #716

@spring-projects-issues

Description

@spring-projects-issues

Veli-Pekka Muli opened DATAJDBC-491 and commented

This is the exception I get:

org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [SELECT "EXAMPLE.USER"."ID" AS "ID", ...

...

Caused by: org.postgresql.util.PSQLException: ERROR: relation "EXAMPLE.USER" does not exist

I have configured the schema like this:

@Configuration
public class DatabaseConfiguration {
    @Bean
    public NamingStrategy namingStrategy() {
        return new NamingStrategy() {
            @Override
            public String getSchema() {
                return "example";
            }
        };
    }
}

Affects: 2.0 M3 (Neumann)

Referenced from: pull request #194

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions