I'm trying to import data from a .csv file into a postgresql 9.2 database using the psql COPY
command (not the SQL COPY).
The input .csv file contains a column with a timestamp in the dd.mm.yyyy hh.mm.ss format.
I've set the database datestyle to DMY using.
set datestyle 'ISO,DMY'
Unfortunately, when I run the COPY
command:
COPY gc_test.trace(numpoint,easting,northing,altitude,numsats,pdop,timestamp_mes,duration,ttype,h_error,v_error)
FROM 'C:data.csv' WITH DELIMITER ';' CSV HEADER ENCODING 'ISO 8859-1'
I get this error:
ERROR: date/time field value out of range: "16.11.2012 07:10:06"
HINT: Perhaps you need a different "datestyle" setting.
CONTEXT: COPY trace, line 2, column timestamp_mes: "16.11.2012 07:10:06"
What is wrong with the datestyle?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…