Closed jcabrerazuniga closed 3 years ago
Same error while trying to run OMOP CDM postgresql ddl.txt CDM v5.3.1 updates
I also got the same error using this PostgreSQL DDL Script on PostgreSQL 9.6.9. I was able to work-around this issue by using SqlRender to translate this script to the PostgreSQL dialect. You can do this via: http://data.ohdsi.org/SqlDeveloper/.
Using SqlRender is not mentioned in the read me so it may be that this script needs an update. Tagging @clairblacketer for awareness and guidance on this item.
Thanks all - the postgres script for CDM v5.3.1 was created using SqlRender but was done before this datetime fix was added to the package. We are exploring the best ways to incorporate historical fixes into the CDM versions so thank you for bringing this up.
This affects me too. I am happy to fix it and make a pull request based on @mgurley's fix.
Should I do that?
Hi thank you for the offer @shabiel but the DDLs are actually developed in a separate repository and this issue has been fixed there using SqlRender. The newly formed CDM development group will work to reconcile these historical bugs this year.
Moving this to done as it addressed by SqlRender
I tried uploading the sql info at:
https://github.com/OHDSI/CommonDataModel/tree/v5.3.1/PostgreSQL
But I got the next errors while running the at the ddl file:
ERROR: type "datetime2" does not exist LINE 9: metadata_datetime DATETIME2 NULL ^ ERROR: type "datetime2" does not exist LINE 14: birth_datetime DATETIME2 NULL, ^ CREATE TABLE ERROR: type "datetime2" does not exist LINE 8: specimen_datetime DATETIME2 NULL , ^ ERROR: type "datetime2" does not exist LINE 5: death_datetime DATETIME2 NULL , ^ ERROR: type "datetime2" does not exist LINE 7: visit_start_datetime DATETIME2 NULL , ^ ERROR: type "datetime2" does not exist LINE 7: visit_detail_start_datetime DATETIME2 NULL , ^ ERROR: type "datetime2" does not exist LINE 7: procedure_datetime DATETIME2 NULL , ^ ERROR: type "datetime2" does not exist LINE 7: drug_exposure_start_datetime DATETIME2 NULL , ^ ERROR: type "datetime2" does not exist LINE 7: device_exposure_start_datetime DATETIME2 NULL , ^ ERROR: type "datetime2" does not exist LINE 7: condition_start_datetime DATETIME2 NULL , ^ ERROR: type "datetime2" does not exist LINE 7: measurement_datetime DATETIME2 NULL , ^ ERROR: type "datetime2" does not exist LINE 6: note_datetime DATETIME2 NULL , ^ ERROR: type "datetime2" does not exist LINE 13: nlp_datetime DATETIME2 NULL , ^ ERROR: type "datetime2" does not exist LINE 7: observation_datetime DATETIME2 NULL , ^ Seems that datetime2 is not supported in Postgress. Any ideas about how to solve this issue?