ha1ogen ha1ogen - 1 month ago 9
PHP Question

Importing csv file into pgsql

I'm trying to upload this CSV file onto my table in pgsql,
but I'm getting this error:


ERROR: invalid input syntax for integer: "mlname,mfname,slname,sfname,address,postalcode,membershiptype,hphone,email"

CONTEXT: COPY members2, line 1, column id: "mlname,mfname,slname,sfname,address,postalcode,membershiptype,hphone,email"


I really understand why I'm getting this error, both my table and my CSV file have the same column names.

members2 is the name of the table and all my columns are charvar, so I don't see how it can be telling me anything about integers.

acm acm
Answer

Your problem is not the field names... The problem is that you're trying to input something into an integer field which is not an integer...

as far as i can see.. you're trying to insert a string into field members2...