【发布时间】:2020-02-01 15:23:11
【问题描述】:
我正在尝试将 csv 文件中的值插入到我的 postgresql 数据库中。 这是我的桌子:
CREATE TABLE AllocatedEICDetail (
Id SERIAL NOT NULL,
EntityCreatedAt timestamp(34) with time zone NOT NULL,
EntityModifiedAt timestamp(34) with time zone NOT NULL,
MRID varchar(250),
DocStatusValue varchar(250),
AttributeInstanceComponent varchar(250),
LongNames varchar(250),
DisplayNames varchar(250),
LastRequestDateAndOrTime timestamp(7),
DeactivateRequestDateAndOrTime timestamp(7),
MarketParticipantStreetAddressCountry varchar(250),
MarketParticipantACERCode varchar(250),
MarketParticipantVATcode varchar(250),
Description varchar(255),
EICParentMarketDocumentMRID varchar(250),
ELCResponsibleMarketParticipantMRID varchar(250),
IsDeleted bool NOT NULL,
CONSTRAINT PK_AllocatedEICDetail
PRIMARY KEY (Id));
以及我要插入的数据:
Id;EntityCreatedAt;EntityModifiedAt;MRID;DocStatusValue;AttributeInstanceComponent;LongNames;DisplayNames;LastRequestDateAndOrTime;DeactivateRequestDateAndOrTime;MarketParticipantStreetAddressCountry;MarketParticipantACERCode;MarketParticipantVATcode;Description;EICParentMarketDocumentMRID;ELCResponsibleMarketParticipantMRID;IsDeleted
47677;2019-04-01 09:26:51.2053104 +00:00;2019-04-01 09:26:51.2053104 +00:00;10T-1001-10010AS;A05;International;Tie Line Koman-KosovoB;L_KOM-KOSB;2018-10-31 00:00:00.0000000;NULL;NULL;;NULL;Tieline;NULL;10XAL-KESH-----J;0
47678;2019-04-01 09:26:51.2053104 +00:00;2019-04-01 09:26:51.2053104 +00:00;24X-LE-TRADING-N;A05;International;LE Trading a.s.;LE-TRADING;2013-12-18 00:00:00.0000000;NULL;SK;;SK2023878747;Trade Responsible Party;NULL;NULL;0
但是当我尝试将 csv 文件插入 pgAdmin 4 时,我得到了这个错误:
错误:类型时间戳的无效输入语法:“NULL” 上下文:复制分配的eicdetail,第2行,列deactivaterequestdateandortime:“NULL”
有什么想法吗?
【问题讨论】:
标签: database postgresql csv