I am using this:
COPY data_table (col1,col2,col3) FROM 'datafile.csv' DELIMITERS ',' CSV HEADER;
to get csv data into my postGIS table. It works wonderfully, except I need to have a 'pk_id serial PRIMARY KEY' in the database table as well, which will then make the columns not match up between 'data_table' and 'datafile.csv'. And I think this will give an error when I run the COPY command.
I could add the pk_id serial PRIMARY KEY after the import, but I want to run many imports into data_table so this doesn't seem like it would work.
So my question is: what is an alternative way to get csv data in - can I still use COPY? Is there a way like in mySQL to "INSERT INTO table_name (col1, col2,col3) VALUES (val1,val2,val3) where I specify the affected database columns?