I am trying load concept.csv into postgres. I get an error message where concept names have inches given as double quotes ("). I got the following error message: value too long for type character varying(255). The actual length of the data is not more than 255. Anyone had a similar issue while loading concept.csv?
Hi @priagopal, good to hear you were able to solve the issue. Could you share how you solved this issue, so that others can learn when they have a similar issue?
I did the following:
\copy concept(concept_id,concept_name,domain_id,vocabulary_id,concept_class_id,standard_concept,concept_code,valid_start_date,valid_end_date,invalid_reason)
FROM ‘your filepath/CONCEPT.csv’ DELIMITER E’\t’ QUOTE E’\b’ NULL AS ‘’ CSV HEADER;
Loading CONCEPT.csv into Postgres fails due to double quotes… everywhere
Double quotes representing “inches” in concept_name
Embedded quoted strings in concept_name
@priagopal Copy command fails on OSX (and I assume Linux) due to the single quote character. I replaced the single quotes with the standard ASCII characters and this works on Mac:
\copy concept(concept_id,concept_name,domain_id,vocabulary_id,concept_class_id,standard_concept,concept_code,valid_start_date,valid_end_date,invalid_reason) FROM 'CONCEPT.csv' DELIMITER E'\t' QUOTE E'\b' NULL AS '' CSV HEADER;
Another practice that I follow:
Load the concept tables before applying contstraints, indexes and PKeys to avoid issues with load order.
The Athena download email still lists the old VocabImport location that only exists in the old GitHub branches
The control files can be found here. They are provided in the folders Oracle/, PostgreSQL/ and SQL Server/ for the respective SQL dialect. The loading scripts are inside the subfolder VocabImport/.