I want to import a CSV file into version 9.2, but the CSV file has a double quote with a double quote at the end position of the column to represent NULL:
"2","1001","9","2","0","0","130","","2012-10-22 09:33:07.073000000",""
which maps to a column of type Timestamp. postgreSQL doesn't like "". I tried setting the NULL parameter, but maybe I am not doing it right? I tried NULL as '"" and NULL '' and NULL as '' and NULL "" , but to no avail; here is my command:
COPY SCH.DEPTS FROM 'H:/backups/DEPTS.csv' WITH ( FORMAT CSV, DELIMITER ',' , NULL '', HEADER TRUE, QUOTE '"' )
but it is not with an error:
ERROR: Invalid input syntax for timestamp type: "
CONTEXT: COPY division, row 2, expirydate column: ""
PS Is there a way to specify a Booleans string representation for the COPY command? The utility that created the CSVs (of which there are many) used false and true.
source share