novice <user.postgresql@gmail.com> writes:
> db5=> \copy maintenance FROM test.txt
> ERROR: invalid input syntax for integer: "3665 OK SM
> 07/07/13 06:09"
> CONTEXT: COPY maintenance, line 1, column maintenance_id: "3665 OK
> SM 07/07/13 06:09"
It looks to me like your problem is mostly that you don't have tabs
between the fields. I don't think COPY can be taught to parse this
input directly --- you need to preprocess the file to split the fields
apart.
BTW: after you get it split into fields, you're also going to find that
"OK" is not valid input for the integer "meter_id" column.
regards, tom lane