4
Guys, 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 for postgres 9.6, but when I use the command
COPY clientes FROM 'C:/clientes.txt' USING DELIMITERS ';'
it only matters the data if the id field is varchared. 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 going on? I also tried to change the column of the varchar table to integer with the following command
ALTER TABLE clientes ALTER COLUMN id TYPE integer USING id::INTEGER
the same error cited above occurred.
In some row the first field on the left comes blank?
– rray
No, all lines have only integer numbers
– Helder Tosta