Geesu
Geesu

Reputation: 6018

Redshift - Adding a column, do we have to change our previous CSVs to include it?

I currently have a redshift table in our database that has 10 columns, and I want to add another. It's trivial to do an alter table to do this.

My question - When I do this, will all my old CSV files fail to insert into redshift (via COPY from S3) given they won't have this new column?

I was hoping the columns would just be NULL vs. it failing on import, but I haven't seen any documentation on this.

Ideally I wish I could specify the actual column name in the header row of the CSV, but I haven't seen if that is possible anywhere.

Upvotes: 6

Views: 446

Answers (1)

Mauricio De Diana
Mauricio De Diana

Reputation: 139

FILLRECORD in COPY command does that: 'Allows data files to be loaded when contiguous columns are missing at the end of some of the records'.

Upvotes: 5

Related Questions