0

I have postgresql database, version 11. There I created database schema 'test'. Sql of that schema:

CREATE SCHEMA TEST
AUTHORIZATION "user-xxx";
ALTER DEFAULT PRIVILEGES IN SCHEMA test
GRANT ALL ON TABLES TO postgres;
ALTER DEFAULT PRIVILEGES IN SCHEMA test
GRANT ALL ON TABLES TO PUBLIC;

My config in spring boot:

datasource:
  platform: postgres
  jdbc-url: jdbc:postgresql://localhost:5432/BDA
  username: user-xxx
  password: user-xxx
jpa:
  generate-ddl: true
  properties:
    hibernate:
      default_schema: TEST

When launching the application I always get following exception:

Can not connect from spring boot to postgresql schema - 'org.postgresql.util.PLSQLException: ERROR: schema "test" does not exist'

If I don't specify the schema then it works with default database schema, and everything is ok.

1 Answer 1

1

I fond the reason. When jpa driver connects to PostgreSQL schema 'TEST' it lowercase the letters, and searches for 'test'. So, I renamed the schema to 'test', and the configuration setting to 'test', and was able to connect then.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.