In my csv I have data like:
123|456|value 1\
My copy command is:
copy "table_name" ("a_id", "b_id", "b_name") from s3:bucket/path.csv delimiter '|' escape;
The problem I'm having is that, because the b_name value (value 1\) ends in a backslash, I'm getting an Extra column(s) found error.
I believe it's because I'm using the escape parameter to escape backslashes and redshift is expecting something to escape after the trailing backslash.
Is there an elegant way to deal with this? I could append another backslash any time I encounter a string that ends in backslash. But that leads to problems if strings end in two or more backslashes, I have to escape every one.