All,
I’m setting up v5 on a fresh laptop using Postgres. I downloaded the CDM and conceptual vocabularies last week. When I attempt to apply the PostgreSQL CDM contraints to a loaded DB (using 1000 patient CMS sample) I’m getting a foreign key violation:
Concept 2313863
ALTER TABLE concept_relationship ADD CONSTRAINT fpk_concept_relationship_c_1 FOREIGN KEY (concept_id_1) REFERENCES concept (concept_id);
[Error] Script lines: 223-224 ----------------------
ERROR: insert or update on table “concept_relationship” violates foreign key constraint “fpk_concept_relationship_c_1”
Detail: Key (concept_id_1)=(2313863) is not present in table “concept”.
Line: 1
SELECT * FROM concept_relationship where concept_id_1 = 2313863
=> 11 records with concept_id_1 = 2313863
select * from concept where concept_id = 2313863
=> 0 records
Concept 2108905
ALTER TABLE concept_relationship ADD CONSTRAINT fpk_concept_relationship_c_2 FOREIGN KEY (concept_id_2) REFERENCES concept (concept_id);
[Error] Script lines: 230-231 ----------------------
ERROR: insert or update on table “concept_relationship” violates foreign key constraint “fpk_concept_relationship_c_2”
Detail: Key (concept_id_2)=(2108905) is not present in table “concept”.
Line: 1
SELECT * FROM concept_relationship where concept_id_1 = 2108905
=> 6 records
select * from concept where concept_id = 2108905
=> 0 records