我想将一些.csv数据导入postgres,但数据类型有问题:
我的属性之一是生日:
1968-06-24 00:00:00因此我使用时间戳,正如pgmodeler所建议的那样。然而,我总是得到这样的信息:
postgres=# \connect new_database
You are now connected to database "new_database" as user "postgres".
new_database=# \copy players FROM '/Users/Desktop/Rdaten/Data/players.csv' DELIMITER ';' CSV HEADER错误:
ERROR: invalid input syntax for type timestamp: "NULL"
CONTEXT: COPY players, line 267, column birthday: "NULL"
new_database=# 我能为此做些什么呢?
发布于 2014-10-30 04:43:15
不确定这是否是相同的问题,但我在尝试导入一个CSV时遇到了这个错误,其中null值被列为' null‘,并通过在copy命令中添加"null ' NULL '“来修复它--默认情况下Postgres希望null值作为空字符串输入。
https://stackoverflow.com/questions/26425070
复制相似问题