How to import a csv

Поиск
Список
Период
Сортировка
От Oliveiros Cristina
Тема How to import a csv
Дата
Msg-id 007401c7e645$0940c4c0$ec5a3d0a@marktestcr.marktest.pt
обсуждение исходный текст
Ответы Re: How to import a csv  (Sean Davis <sdavis2@mail.nih.gov>)
Список pgsql-novice
Hi, I am trying to import a file into a table.
 
The file has the form
integer, string
integer, string
 
Table has 5 columns, but I just need to fill the first two, the others can remain blank
 
I've tried COPY table1 FROM 'C:\\file.txt'
 
But PGAdmin ||| complains
with the following :
ERROR: invalid input syntax for integer: " 319613 , Sapo  "
SQL state: 22P02
 
319613 , Sapo is the very first line of the file.
It seems that it is trying to put the pair (integer, string) in the first column alone
 
How can I fix this?
 
Thanx in advance for your help
 
Best,
Oliveiros

В списке pgsql-novice по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Truncate table
Следующее
От: Sean Davis
Дата:
Сообщение: Re: How to import a csv