将CSV文件上传到PostgreSQL表时出错

时间:2019-05-27 10:49:08

标签: postgresql file-upload

我已经创建了一个表格-

CREATE TABLE test(
TID INTEGER PRIMARY KEY,
src VARCHAR(50),
title VARCHAR(50),
date DATE,
start time,
end_time time,
cat VARCHAR(50),
gen VARCHAR(50),
cap INTEGER,
pc numeric,
test1 INTEGER,
test2 INTEGER,
test3 INTEGER,
test4 INTEGER,
test5 INTEGER,
test6 INTEGER,
test7 INTEGER);

我正在尝试使用-

加载csv文件
COPY test FROM 'test.csv' WITH (FORMAT CSV,HEADER true,NULL '', DELIMITER ',');

我收到以下错误-

ERROR:  missing data for column "src"
CONTEXT:  COPY events, line 261: ""260,src2,""Mast Dir, 3. Tag"",2013-08-21,11:45:00,,TODO,,104,30.0,1,7,,,,,""

如何处理此错误?

0 个答案:

没有答案