Answer the question
In order to leave comments, you need to log in
PostgreSQL: How to add data?
I have columns: col1 text, col2 text, col3 double precision, col4 double precision, col5 numeric. Need to write data: text, "text2", "439, 86 [404]", "0.39", "0.11", "37.70%".
The code:
test=# COPY dataToImport2 FROM '/opt/DataToImport2.csv' WITH (FORMAT csv);
ERROR: invalid input syntax for type double precision: "0,39"
CONTEXT: COPY datatoimport2, line 1, column summaprodazhtyisrub: "0,39"
Answer the question
In order to leave comments, you need to log in
First, copy to another table with text fields (temporary table is quite a suitable place), then insert .. select with a request to transfer where necessary with any manipulations along the way.
Or make a storage in any language and read the file through it, converting the data along the way.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question