I'm trying to insert data into some tables of a Postgres database with a bash script. I got it working like this
psql -c '\copy raw.ap1_1 from file.csv with csv header;'
The problem is I wan't to give the copy command the Quote option, but I can't get it to work because of the quotes outside. I've tried wrapping single quotes in double quotes, double quotes in single quotes, using a backslash to escape quotes, etc.
What is want is something like this:
psql -c '\copy raw.ap1_1 from file.csv with csv header quote as '"';'
But of course I can't do that because the quotes are taken as part of the bash script. I either get a postgres syntax error, or I get a parsing EOF error (because the quotes override themselves).