I have a *.csv
file which I want to import into my database. basically it looks like that:
2013.11.07,11:50,1.35163,1.35167,1.35161,1.35163,15
2013.11.07,11:51,1.35166,1.35173,1.35165,1.35170,21
2013.11.07,11:52,1.35170,1.35170,1.35163,1.35163,11
I am using:
DROP TABLE table;
CREATE TABLE table
(
id SERIAL primary key,
Date Date,
Time Time,
Open double precision,
High double precision,
Low double precision,
Close double precision,
Volume bigint
);
COPY table FROM 'C:\\Users\\user\\EURUSD1.txt' DELIMITER ',' CSV;
However I am getting at the Date:
ERROR: invalid input syntax for integer: "07/11/2013" CONTEXT: COPY eurusd_m1, line 1, column id: "07/11/2013"
I really appreciate your help on how to fix that?
create
statement matches the csv(id
isSERIAL
). If I am wrong please show me! – user2051347 Jan 17 at 18:55id
column. – Abhinav Jan 17 at 18:59