OHDSI Home | Forums | Wiki | Github

FATAL: database "ohdsi" does not exist

Hello, I have been following the instructions on https://ohdsi.github.io/CommonDataModel/cdmRPackage.html to use the CDM R package.

When I run
CommonDataModel::executeDdl(connectionDetails = cd, cdmVersion = "5.4", cdmDatabaseSchema = "ohdsi_demo")
I get this error
Error in rJava::.jcall(jdbcDriver, "Ljava/sql/Connection;", "connect", : org.postgresql.util.PSQLException: FATAL: database "ohdsi" does not exist

Does the ohdsi data base no longer exsit on the server? Or is it something I didn’t do right.

I am using R 4.2.3 and here is the connection detail:

cd <- DatabaseConnector::createConnectionDetails(dbms = "postgresql",
                                             server = "localhost/ohdsi",
                                             user = "postgres",
                                             password = "password",
                                             pathToDriver = getwd())

The error message indicates there is no database called ‘ohdsi’ in your Postgres server. Note that in Postgres there’s a difference between ‘database’ and ‘schema’. The database is part of the server name when creating connection details: 'localhost/ohdsi. The schema name is the cdmDatabaseSchema argument you’re asked to provide later.