相关文章推荐
近视的大象  ·  Android弹出DatePickerDia ...·  2 年前    · 
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams
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));

and the data I want to insert:

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

But when I try to insert the csv file to pgAdmin 4 I get this error:

ERROR: invalid input syntax for type timestamp: "NULL" CONTEXT: COPY allocatedeicdetail, line 2, column deactivaterequestdateandortime: "NULL"

Any ideas?

The error message implies you have a literal "NULL" (string) in your input data. You probably should try replacing those with empty values like shown below:

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;;;;;Tieline;;10XAL-KESH-----J;0
        

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.