0

I am trying to convert a .csv file to a postgres database. I have set up the database with the appropriate number of columns to match the .csv file. I have also taken care to strip all "," (comma characters) from the .csv file.

Here is my command I am typing into psql:

COPY newtable FROM 'path/to/file.csv' CSV HEADER;

I have tried everything I can think of. Any idea how to fix this?

linusg
  • 6,289
  • 4
  • 28
  • 78
dd_123
  • 93
  • 1
  • 7
  • Check this out http://stackoverflow.com/questions/2987433/how-to-import-csv-file-data-into-a-postgresql-table – Polo D. Vargas Apr 21 '16 at 20:04
  • `I have also taken care to strip all "," (comma characters) from the .csv file.` Huh? That would imply that the input consists of only one field. – wildplasser Apr 21 '16 at 22:27
  • First, why is this tagged python. Second, you do convert a csv into a database but import csv data into database table. Please show content f file for us to help. – Parfait Apr 22 '16 at 00:19

0 Answers0