I'm trying to import a CSV file into Postgres 9.2 using the COPY command. For all columns, empty strings in the CSV must be interpreted as NULL with the exception of one column.
I believe FORCE_NOT_NULL option is meant to allow this, but when I enter the following command:
COPY migr_escolas from 'C:\escolas.csv'
WITH DELIMITER ',' CSV HEADER FORCE_NOT_NULL;
I get the following message:
ERROR: syntax error next to "FORCE_NOT_NULL"
LINE 16: ...om 'C:\escolas.csv' WITH DELIMITER ',' CSV HEADER FORCE_NOT_...
Is FORCE_NOT_NULL really supported? If so what's the syntax?
System Info:
"PostgreSQL 9.2.1, compiled by Visual C++ build 1600, 64-bit"
Windows 7 64 bits
As pointed by joop's comment above, one should use FORCE NOT NULL and not FORCE_NOT_NULL.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With