COPY column order
You can't issue an SQL query in copy from
. You can only list the columns.
If the CSV columns are in the b, a, c
order then list that in the copy from
command:
copy target_table (b, a, c)
from file.csv
with (delimiter ',', format csv, header)