Missing data for column while trying to copy a csv file in a postgresql database -


i have issue trying copy csv file in table. here sql statement:

drop table if exists nom_graph;   create table nom_graph  (     date            varchar(50),     edp_rec     float,     edp_ec      float,     nb_ko       float ); \copy nom_graph '/home/giutools/edp/out/synthese_resync.csv' (delimiter('|'))  ; 

and error get:

psql:nom_graph.sql:179: error:  missing data column "edp_rec" context:  copy nom_graph, line 1: "date;edp_rec;edp_ec;nb_ko" 

the csv file composed : date ; , other values float.

i can't understand what's issue, been trying solve 2 days now.

the problem csv file,

step1: convert excel file csv using http://www.zamzar.com .

step2: create table in postgresql same column see in excel file.

step3: copy csv file created table using below command,

copy table_name (column1,column2,..) 'c:\users\public\lifile_name.csv' delimiter ',' csv header; 

done, hope find helpful!


Comments

Popular posts from this blog

scala - 'wrong top statement declaration' when using slick in IntelliJ -

c# - DevExpress.Wpf.Grid.InfiniteGridSizeException was unhandled -

PySide and Qt Properties: Connecting signals from Python to QML -