Load CSV into Redshift, with header?

Some Guy picture Some Guy · Mar 1, 2015 · Viewed 22.3k times · Source

Is there an option to load a CSV into Redshift with a header? I see the documentation for CSV but it says nothing about a header. Ideally it could use the header to determine the columns to load.

Answer

John Rotenstein picture John Rotenstein · Mar 1, 2015

Use the IGNOREHEADER 1 option when using the COPY command:

IGNOREHEADER [ AS ] number_rows

Treats the specified number_rows as a file header and does not load them. Use IGNOREHEADER to skip file headers in all files in a parallel load.

See: Amazon Redshift COPY command documentation