OHDSI Home | Forums | Wiki | Github

Error loading concept names

Hi All,

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?

Thanks,
priya

Please, check field delimiter and quote character. May be problem with wrong settings of this parameters?

Thank you. I was able to solve it.

Thanks,
Priya

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?

Hi Maxim,

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;

1 Like

Loading CONCEPT.csv into Postgres fails due to double quotes… everywhere

  1. Double quotes representing “inches” in concept_name
  2. 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.

Bill

1 Like

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/.

The old Postgres loading file:

t