OHDSI Home | Forums | Wiki | Github

Configure Source and Source Daimon Tables (ATLAS)

Hi There,

After deploying WebAPI on Tomcat I have the tables appearing under the webapi schema

I’ve moved on to the next step which is “Configure source and source_daimon tables> WebAPI SOURCE and SOURE_DAIMON Inserts”, where I ran the following code in the PostregSQL SQL query editor.

INSERT INTO ohdsi.source (source_id, source_name, source_key, source_connection, source_dialect) VALUES (1, 'My Cdm', 'MY_CDM', 'jdbc:postgresql://127.0.0.1:5432/OHDSI?user=ohdsi_admin_user&password=admin1', 'postgresql');
INSERT INTO ohdsi.source (source_id, source_name, source_key, source_connection, source_dialect) VALUES (2, 'Default vocabulary', 'vocab', 'jdbc:postgresql://127.0.0.1:5432/OHDSI?user=ohdsi_admin_user&password=admin1', 'postgresql');

However it produces the following error

ERROR: relation “ohdsi.source” does not exist
LINE 1: INSERT INTO ohdsi.source (source_id, source_name, source_key…
^

********** Error **********

ERROR: relation “ohdsi.source” does not exist
SQL state: 42P01
Character: 13

I understand that there should be an ohdsi.souce schema but can’t seem to find it anywhere.
Appreciate any advice greatly

Thanks

From your other thread, you set up a schema called ‘webapi’ not ‘ohdsi’. Your database was called ‘ohdsi’, but the schema containing the webapi tables is called ‘webapi’. So, change your inserts to insert into ‘webapi.source’.

Thanks @Chris_Knoll!

Hmm, I wonder why only the schema webapi and not ohdsi was created… but anyways will try inserting into webapi schema instead. Would not having an ohdsi schema pose a problem when using ATLAS in future?

Thanks for all the help!
Regards,
Hui Xing

The webapi schema was created from the value specified in your settings.xml file:

<datasource.ohdsi.schema>webapi</datasource.ohdsi.schema>

There’s no problem with having the WebAPI tables created in that schema, just don’t move them manually. In the future as you install new versions of webAPI, the database will be automatically updated to support the new version of WebAPI. If you move the tables to another schema, however, the system won’t know they moved, and you have problems.

-Chris

t