Personal I have the following problem: I have a file in txt format with the following information:
1;Helder;Masculino;GO
2;João;Masculino;RJ
3;Maria;Feminino;PR
4;Pedro;Masculino;MA
I used this example to test the import to postgres 9.6, but when I use the
COPY clientes FROM 'C:/clientes.txt' USING DELIMITERS ';'
It only imports the data if the id field is like varchar. When I create a table with the id field as integer it always gives the message
invalid input syntax for integer
Can anyone tell me what might be happening? I also tried changing the column from the varchar table to integer with the following command
ALTER TABLE clientes ALTER COLUMN id TYPE integer USING id::INTEGER
The same error mentioned above occurred.