I am trying to import data into postgres. Data fields are comma separated, strings may contain commas, in which case those are escaped:
create table v (a varchar);
Import command (run under Linux from bash)
cat data.csv | psql -d database -c "copy v (a) from stdin with delimiter ',' escape '\\' CSV header"
ERROR: extra data after last expected column
I've been fighting and google against this problem for quite a few hours and do not understand what I am doing wrong?