I'm trying to import a CSV file into a table in Postgres, and it's bombing out on the first date field. The dates are in the format
dd/mm/yyyy and there isn't a date in the field in question in the CSV.
As such I'm using the following:
set datestyle = 'ISO,DMY'; \copy companies_house_snapshot FROM 'BasicCompanyDataAsOneFile-2017-04-01.csv' WITH DELIMITER ',' CSV HEADER NULL AS '';
Which I thought should be sufficient, the error message is:
ERROR: invalid input syntax for type date: "" CONTEXT: COPY companies_house_snapshot, line 2, column dissolution_date: ""
dissolution_date is nullable and in the CSV as
I'm using PostgreSQL 9.5.6 on Ubuntu 16.04
Where am I going wrong?
If I use
NULL, I get:
ERROR: CSV quote character must not appear in the NULL specification