我正在尝试使用Postgresql COPY并将文件导入数据库。第一个字段是日期字段。我仍然收到错误:
Error : ERROR: invalid input syntax for type date: "2014-01-24"
CONTEXT: COPY test_darwin, line 1, column datelastmodified: "2014-01-24"
这个领域在我看来是一个完美的约会。即使我将日期从另一条记录复制到导入文件中。
这是我的代码:
COPY test_table (datelastmodified,institutioncode ,collectioncode, catalognumber, scientificname) FROM '/Users/asle/Desktop/import_test'
和我的导入文件(以制表符分隔):
2014-01-24 Fokus Fokus 333401 Merodon equestris
2014-02-03 Fokus Fokus 346618 Thanatophilus rugosus
2014-01-24 Test Group MFU 189028 Potentilla argentea
2014-01-18 Fokus MFU 342969 Erigeron borealis
2014-01-18 Fokus Fokus 352801 Galium palustre
2014-01-24 Fokus Fokus 158921 Cassida rubiginosa
2014-01-18 Fokus Fokus 353450 Equisetum pratense
2014-01-18 Fokus MFU 343084 Draba norvegica
2014-01-18 Fokus MFU 296983 Trifolium medium
2014-01-18 Fokus Fokus 296983 Bryum rubens
2014-01-24 Fokus Fokus 355254 Fragaria vesca
2014-02-03 Fokus Fokus 341767 Bombus ruderarius
2014-01-24 Test Group MFU 188806 Luzula multiflora multiflora
2014-01-18 Fokus MFU 351029 Solidago virgaurea
2014-01-18 Fokus MFU 351017 Anthoxanthum odoratum
2014-01-24 Test Group MFU 188772 Lotus corniculatus