I’m trying to import data from csv file into existing table but got below error message:
ERROR: cannot IMPORT INTO a table with a DEFAULT expression for any of its columns
The SQL statement is:
IMPORT INTO bank CSV DATA ('nodelocal://1/bank.csv');
and the table structure is like below:
CREATE TABLE bank ( code VARCHAR(10) PRIMARY KEY NOT NULL, name VARCHAR(50) NOT NULL, status INT4 NULL DEFAULT 1);
(The CSV file contains values for all of these three columns)
But if I remove the DEFAULT value from column STATUS, the same IMPORT INTO statement works find.
The version of CockroachDB I’m using is v20.1.5.
Is this a known limitation? Because I don’ see any description about this in the docs.