0

I create a database by installing Postgres on my ubuntu 20.04 machine and used the following commands to create it:

sudo su - postgres
psql
CREATE USER preopus WITH PASSWORD 'admin222';
CREATE DATABASE preopusDB WITH OWNER=preopus;

and received no errors. When I tried using slick-codegen by calling the database with this URL: "jdbc:postgresql://localhost/preopusDB?user=preopus&password=admin222", it gave me the error:

[error] (run-main-0) org.postgresql.util.PSQLException: FATAL: database "preopusDB" does not exist

If anybody can help it would be greatly appreciated.

asked Jan 10, 2021 at 19:44
2
  • 1
    Does it work if you use preopusdb (all lowercase) in the URL? Commented Jan 10, 2021 at 19:53
  • Duh. Thank you very much. Commented Jan 10, 2021 at 20:20

1 Answer 1

1

As a_horse_with_no_name mentioned, the database name (and possibly other parameter values) in the JDBC URL are case-sensitive. But any unquoted identifier like preopusDB in your CREATE DATABASE statement will be folded to lower case.

Use

jdbc:postgresql://localhost/preopusdb?user=...

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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.